I think you have the question mixed up. Rhyhorn doesn't actually learn surf, but it's evolution, Rhydon can. So, I'll tell the reason from Rhydon's perspective.
Rhydon and it's evolution are based off of the Indian Rhinoceros. According to this article, Rhydon (an Indian Rhino) can in fact swim, but its babies (Rhyhorn) can't, which is why Rhyhorn can't learn it but Rhydon can.
Hope I helped! :)