It was a rather elaborate way for Castiel to share the Angels knowledge of Azazel's activities and bring Dean up to speed.
From the transcript:
DEAN I couldn't stop any of it, she still made the deal, she still died in the nursery didn't she?
CASTIEL Don't be too hard on yourself, you couldn't have stopped it.
DEAN What?
CASTIEL Destiny can't be changed Dean, all roads lead to the same destination.
DEAN Then why'd you send me back?
CASTIEL For the truth, now you know everything we do.
DEAN What the hell are you talking about?
CASTIEL We know what Azazel did to your brother, what we don't know is why, what his endgame is. He went to great lengths to cover
that up.
From a storytelling stand point, it establishes a level of pre-destination into the Supernatural universe, the notion that whilst changes can be made the end destination is always the same, this would come into effect more later in season five, and Dean's fight against his destiny.