WASHINGTON—The White House defended the firing of acting Attorney General Sally Yates, who was ousted Monday night after telling government lawyers not to defend President Donald Trump’s executive order that suspends immigration from seven Muslim-majority countries out of concerns that terrorists might enter the U.S.

White House press secretary Sean Spicer said at his press briefing Tuesday that Ms. Yates failed to enforce an order that was “designed to protect the American people.” He said the order was not “extreme” but...