Those look rather like (though not identical to) the egg cases of a small local whelk called an oyster drill. Whelks are predatory snails, so often not terribly welcome in our little reefs.
"Snails" is a pretty big class of critters - kind of like "mammals".
Bats are mammals - good to have around, as they eat mosquitoes. Sheep are mammals - good to have around, as they keep your lawn trimmed (and keep you warm in the winter, but we digress...) It does not hold true that you want a tiger - although also a mammal - in your neighborhood.
The snails we pay for in our cleanup crew eat algae, detritus, leftover fish-food. Some of these whelks ... eat the cleanup crew. (As do creatures like tulip snails, pyramidellids and Babylonia . . . )
~Bruce
P.S. & BTW, I think Crabs McJones may have nailed this ID, there . . .