First, why it was good! It was based on a very funny sarcastic novel from the 1930's, the same author also created Topper! Google Topper or Thorne Smith for more details! Second, it's 2 leads were both Emmy award winning actors, (Sharon's Emmy's came later in Cagney and Lacey).
Third, it was a body-swapping comedy that was before it's time. In the late 80's half a dozen movies came out with similar themes, creating a subgenre of films that still interests people decades later. Why it failed.
It was simple. It was placed at 930 friday evening - the Death slot for shows - and it followed Hello Larry, which was the standard for worse show ever for many years after. (despite the fact that it was actually a decent comedy). And it was thrown up opposite the #1 show Dallas at its peak in ratings. It didn't stand a chance!