Property rights are exclusionary in nature. I cant use my land to build something that would be a nuisance but I can exclude others from coming onto my land, even if it's because I don't like guns.
Also, rights are not violated by other citizens, only by the government. Another citizen telling you to stay off their property with your gun is not the same as the government telling you that you cannot possess a particular weapon.
This law is the government restricting a private property right. It looks to me like a lot of people are OK with "reasonable restrictions" on other people's property rights so long as it benefits them.
As for the analogy to a friends house, if they find you have a gun in your car, ask you to leave, and you don't, then you are trespassing. If an employer finds you are not complying with an employment agreement, they should be free to fire you.
Just my two cents.