Rex got fired because he said to Pegs "I can't work with Whaley so you need to fire one of us" and in that case the easy move is to fire the guy who is the face of the dysfunction: the head coach. Plus Rex did a poor job.
By comparison, Pegs clearly thinks Whaley has done a good job and deserves a chance to pick his own HC.