Why did Joseph II grant religious tolerance? What was the purpose?

http://en.wikipedia.org/wiki/1782_Edict_of_Tolerance