Anything that stings them, be it corals (not just sps) or anemones will eventually lead to wounds that get infected with nasty bacteria like the vibrio types, ESPECIALLY in temperatures above 74°F that most reef tanks are kept at to satisfy the coral needs.
As to WHY they don't avoid things that sting, I don't really know. It may be that they don't have "nerves" that sense the stinging and once the bacteria infect the wound they have no correlative memory to associate the two stages.
Soon after I started seahorse keeping 18 yrs ago, I transferred some mushrooms to the seahorse tank and found out the hard way that even some mushrooms sting seahorses.
Anecdotally, over the years reading on seahorse.org of people keeping seahorses in reef type situations, there were MANY posts advising that some sps don't fare well with seahorses because the seahorses with their rudimentary digestive tracts, and their process of masticating the food as they snick it up, passing the micro particulate matter out through their gills and into the water column, create "dirty" water that some sps can't tolerated. And that's in addition to the temp issue.