It makes sense if you think about it. Samurai were professional warriors, and fighting folks at arms length with a piece of sharp metal seems incredibly risky. Instead, why not pick off your enemies at a distance? That's why in real samurai tradition, they followed Kyuba no michi: the way of the horse and bow. The samurai's fabled sword was used more as an awkward last resort type of thing.
But that all changed in the 16th century, when guns began to become a thing. Ousted from the battlefield by superior ranged weaponry, the samurai took the rolls of bureaucrats and officials.
This is when the symbolic katana became a thing. It became the go-to weapon of the honorable, dance-fighting, bushido following and completely fictional samurai that they had retroactively imagined in order to make them feel better about their crummy new desk jobs.