That’s like saying genocide is ok because we need to decrease our population. They are mutual exclusive motivations.
I don't think either of those motivations is okay, in fact, I think the action being taken on either basis alone would be, and a fortiori them being taken with both motivations is, a serious abuse of executive power.