Because bear spray is a product designed to safeguard people, but that can be misused and used as a weapon instead? Just like a hammer, knives, ladders, chairs, ottomans, tiles, house-cleaners, string, forks, trowels, etc etc.
It is, of course, too simple to label all guns as being designed primarily as a product designed to kill people. However, there are most categories of guns (like assault weapons, the vast majority of handguns, etc) are designed as weapons to shoot people. So leaving the few guns made for target shooting and hunting small animals when guns are used to shoot people, it may be illegal but it is not an unintended use of the product. Guns shooting people are what guns are made for, for the most part.
The US constitutional amendment that protects your right to bear arms does so with the intention that you will shoot people, if needed. The amendment does not protect your right to go hunting... that is just a byproduct. The amendment protects your right to shoot at a people who form a government you believe to be tyrannical. Except that if you start and lose that shooting match you may then be accused of treason since attempting to overthrow the government is also forbidden by the constitution.