WASHINGTON—White House press secretary Sean Spicer resigned on Friday over objections that President Donald Trump has hired financier Anthony Scaramucci as his new communications director, a White House official said.

The White House named Sarah Huckabee Sanders the new White House press secretary.

In a statement read by Ms. Sanders in the...