The refs only sort of cost Miami the game. They were correct to award the Steelers the ball because the replay rules state that they can only overturn possession if it's a clear cut recovery, which it wasn't.
However, if the refs had gotten the fumble call correct the first time around, then it would have been the who recovered the ball at the bottom of the pile to determine possession. On TV, they showed a Dolphin coming out of the pile with the ball, so it's likely Miami would have won the game if the refs had gotten the call right on the field.
I don't know. On those types of plays where it's unsure, it's probably better to let it play out and then overturn it later to be a TD rather than blowing it dead early so that things get screwed up on the recovery.