Um... if someone pays you to do a thing, then they own it. Imagine if you paid me a hundred thousand dollars to build a house and then it's my house to live in. Doesn't make any sense at all.
I'm not defending the company, but the law is pretty clear on this. If you want to own your own work, then start your own company.
The world is full of tech companies that pay stock options/etc, if that's how you want to be paid then you can do that.
Personally I have no interest in that at all and have always turned it down. If I'm going to own shares in a company, then I want voting rights. Nothing worse than watching investment be run by someone you disagree with... actually there is something worse. A company where every single employee has control/voting rights. That would be a complete disaster.