It's part of the whole "tyranny of the majority" thing. Sorry, I can't remember the exact context in which this was originally mentioned, hopefully someone who has studied civics more than I did can elaborate. However, I'm fairly certain that our founding fathers, while they didn't write this into the constitution, did speak of, and attempt to safeguard against the tyranny of the majority. Isn't that why the Judicial branch is given the power to declare a law unconstitutional, no matter what majority passes it?
Now "tyranny" is a pretty strong word for putting a religious object on government property, but the idea is the same. Just because we are a democracy, does not mean that the majority should be allowed to ignore the rights of the minority.