Your boss may not be wrong for patenting your work.
If your work contributed to or is a piece of code or software that your company relies on for revenue, what happens if he doesn't patent it? Someone else does. And then turns and sues your company for using "their" code. It's not hard to see where that leads. Company going under, you and your boss getting fired, etc, etc.?
I don't like it any more than the next Slashdotter, but it's not hard to picture that exact scenario.
You may have to just grin and bear it.
Bottom line -- software patents have their advantages and disadvantages, but refusing to file a patent seems like a bad career move to me.
Your cause, while subjectively nobel, will be a very quiet and lonely one. Fired or not.
If it makes you sleep better at night, go on ahead. Frankly, I am more interested in paying my bills AND helping keep my employer in business.
There's no sense in being precise when you don't even know what you're talking about. -- John von Neumann