Actually, this isn't as illogical as you might think (though the panel is still comical in it's own right). The difference between TM and HM lies in the relation with the trainer : TM are pokemon technique that many different species tend to learn about naturally, because they know them as instinct. HM, in other hand, are techniques developped by humans through human mind sense of conceptualization ; it's the way human tend to do and use things or tool a certain way to obtain a result or a function that differ greatly from natural standards.
To put it in another way, a "fish" such as kyogre doesn't need to be taught to swim the same way a human isn't taught at birth how to walk, however that logic only applied to himself. Because as a trainer's pokemon : it need to be taught how to swim WITH another being on his back, WITHOUT killing him or injuring him (the same logic applies to flying pokemon). For exemple, have you ever seen the training of an Orca in a swimming spectacle ? And how even with the best trainers to teach them numerous tricks, including "surfing on their nose", they can still fatally injure their human partners at the slimmiest mistake ? And now put that logic in application to pokemon ; where any damn last single one of those creatures can pack enough of a punch to kill a human...
As a trainer : would you trust your life casually in their individual instinct on your first encounter ? Or would you rather try to "train them" with HM in order to ensure you will not accidentally drown 500ft underwater neither be dropped from a 1000ft high from the sky ?
Well, i don't know your choice but i've made mine.