It is in fact the case that we do often do bad things for more important goals. We kill people in wars. We support legal systems that we know sometimes imprison innocent people. The government takes money from people against their will for their own purposes, which isn't stealing mostly only because it's written in law.
What's the difference? Well, in those latter cases, it is actually considered better in sum for that action to be taken. For most of the examples in the post, there are simple and clear arguments that it is not better in sum, and the only reason the article is claiming otherwise is that the author is pretending to be dumber than they are by not mentioning the rest. So don't do that.
(And for some cases, though you wouldn't know it from the article, the full utilitarian calculus does actually say that uncomfortable things are the right thing to do, and in those cases you should just bite the damn bullet.)