Can't help much with the 'why' as it could be down to many things. Is it all other dogs, or just certain ones - males, larger dogs, a specific breed? Has he had a fight/incident with another dog prior to the behaviour change? Have there been any changes to the household/his routine which might be stressing him? Is he ok in all other aspects; eating alright, relaxed in the house etc? Keep an eye on him when walking; on his body language, his reactins to various things, and try to identify patterns; you may be able to get an idea of what's making him act aggressively.
Not knowing what's causing him to act like this, you sort of have to treat all angles - check him over; get the vet involved possibly, and rule out any physical cause. Encourage good behaviour, and be firm but reasonable when disciplining bad behaviour (don't, as my mother did, spend 5 minutes verbally scolding a dog, just because she was embarrassed that he barked and lunged (whilst on lead) and wanted to look like she was doing something about it. Instead give a strong 'no' and walk him away, and when he is walking nicely reinforce that with praise and treats.)
First, and foremost, if you aren't already, I would advise you to keep your dog on lead at all times when walking in an area frequented by other dogs. As said in another thread, it's generally assumed, by dogwalkers, that a dog off lead is safe for other dogs to approach.
In regards to stopping the behaviour, my advice would be a sort of distraction technique. Have treats with you at all times and regularly stop, ask him to do something - sit beside you, sit before you, look at you - something that means his focus is on you. Reward the behaviour with praise and treats (I'm just assuming that, as he's a retriever, he's treat-focused. Could well be wrong there. Reward with whatever he will respond to.) This will at least give you a little more of a chance of getting him to listen to you when there are other dogs around.
If you can't find a way of sorting this out, maybe look into seeing a behaviourist. My dad, who took on the dog I mentioned earlier that my mum was having difficulties with, called a local behaviourist team, who brought their own dogs and spent a session with Dad and the dog and confirmed that he was in the most part simply excited and happy to see other dogs, but with more aggressive tendencies toward entire males (being entire himself.) At 3 or 4 years old, it's quite possible that this has become a learned reaction, and that castration won't solve it, keeing him an on-lead dog forever, which is why you need to find a way to put a stop to this sort of behaviour fairly quickly. Your vets should be able to point you toward a behaviourist if you need.