I won't speak to rather or not it's legal, but it's not that unusual. Essentially there are two separate mindsets when it comes to sharing pay amounts (and benefits).
The first, and probably "oldest", certainly the most common (and the one I prefer) is to never tell your co-workers what you make. The reasoning is that you may be worth more than your co-workers for one reason or another. In fact, you may be getting more money then your supervisor because you're worth more to the company. Remember what the company pays you is between you and the company. You negotiate it, and just as you would not accept "but we pay Bill less", you can't expect them to respond to, "you pay Susan more". The good side of this is that everyone should have the ability to work for what they think they are worth. The downside is that it becomes harder for employees to track whether they are being discriminated against.
The other idea is to share with everyone your pay. That way you can make sure you're getting the same as everyone else. The good side is that you know you are getting fair treatment because everyone earns $11.50 an hour. The downside is that you basically have no negotiating power. If you want $12.00 an hour you're SOL, because it means I would have to give everyone $12.
With regards to not sharing pay outside the company, it gets more fuzzy. Do I want prospective employees to know that I pay $11.50? What does that do to my (the company) ability to negotiate, and more importantly my ability to attract better talent by offering better benefits?
Whether or not an employee can be held to that contract is something that a lawyer would need to answer. But the idea is common, and the reason behind it is not as sinister as some people think.