Retreat where?
5...Ba5? loses the bishop
5...Be7 6.e4 gives white exactly what he wants in the center (very anti-Nimzo)
Would you seriously go 5...Bd6?
The only place this bishop can go is to c3 which is, unfortunately, occupied by a knight.
Therefore 5...Bxc3 6.Qxc3 d5
Yeah, there's your answer, in bold.
You weren't pinning the knight because you intended to inflict doubled pawns on your opponent. You were pinning it because the pin prohibits e4.
That's why in lines that go, for example, 4.Nf3 (which allows an instantaneous doubling of the pawns, if black so chooses), black will generally respond with 4...c5, or 4...b6, or 4...0-0, or even 4...d5, all of which leave the pin intact.
I've been looking through the Nimzo opening as part of the study plans that are on this site. I'm trying to make sure I understand the whys of the moves instead of just the moves themselves.
With the white queen in that position black no longer gets the result of doubling white's pawns with the exchange.
So why is the exchange still the correct move instead of retreating the bishop?