While I don't disagree that it's usually bad writing, I've often seen this sort of scenario presented, and accepted by the audience, as a case of the protagonist being "forced or tricked into doing evil", as if it made the tricked or forced character less good or more evil for having done the thing they were forced or tricked into doing.