I didn't say it was right, but that's the way it is.
If you trash your boss or your workplace in a public forum, then they can find lots of "legal" reasons to let you go. Think about it...if your boss was looking for a reason to get rid of you, how many of you out there come in two or three minutes late, take a personal call at work, browse the web, etc... If you're on the boss' good side, he/she turns a blind eye...if they don't like you, then you get written up.
There's laws to protect workers, sure...but there's lots of ways for companies to still fire you, but stay within the confines of those laws.
Someone shouldn't realistically be surprised that the company will start watching them looking for a legit reason to get rid of them if they trash their boss or workplace publicly.
Again...doesn't make it right, but that's just the way it is.