I just saw the reason why Yuji Naka's sonic made Sonic unable to swim:He eventually learned otherwise after visiting a hedgehog shelter in Germany, but Naka decided to make Sonic unable to swim because he thought it would be better to have the incredibly brave and incredibly fast hedgehog hero have a weakness, something he "wasn't good at as a character" - though.Sonic wants to be taught to swim so he can be smart so it doesn't become Sonic's weakness.
Well, in Adventures of Sonic the Hedgehog and in Sonic the Hedgehog SatAM, Sonic is able to swim without any problems whatsoever, and in one episode of Sonic X, he was briefly able to overcome his aquaphobia to save Amy from drowning