SECNAV is appointed by POTUS and confirmed by the Senate. Esper did not request Spencer’s resignation without consulting the White House. It was likely Trump’s staff that contacted SECDEF about the backdoor negotiations.
http://freerepublic.com/focus/news/3796260/posts?page=51#41