In the same way, someone who robs a bank is (perhaps) acting optimally for someone whose goal is "get money" and who doesn't have other goals like "don't break the law" and "don't take stuff that isn't yours".
And if someone sleeps with your spouse and then kills you lest you take revenge, then (provided they do it carefully enough) they may be acting optimally for someone whose goal is "sleep with that person I fancy" and who doesn't have other goals like "don't encourage people to cheat on their spouses" and "don't commit murder".
If someone says "X acted obnoxiously" or "X acted immorally" then pointing out that there's some unpleasant/immoral set of goals X may have had that for which their behaviour was optimal misses the point of the criticism, which is to say "their goals apparently don't include being a decent person". hellofunk wasn't saying that Schwarzenegger was ineffective but that he was a bad person.
But by all means let's replace those examples with others where it's less surprising for the actions in question to be optimal. A politician voting in ways that they know aren't best for the country, because they know it will help them walk into a nice job after they leave office: optimal for the goal of getting a comfortable life. This makes no difference to the point, which is that "It was effective for his goals" is no defence against a complaint that's about values rather than effectiveness. hellofunk was not accusing Schwarzenegger of acting ineffectively, but of acting immorally and unpleasantly, and "it was the most effective way to get power" is simply not responsive to that criticism.