I would have to agree with Khemul. In the vast majority of circumstances, the worms in our tanks fulfill an important purpose--everything from eating carrion and detritus to actually eating algae (who doesn't want free algae eating animals?). They aren't the prettiest things, but they are quite useful in most cases.
In your particular case, if you could provide some images of the worm in question, it would be very helpful. If you have a true "fireworm," then they have a preference for coral flesh. You would see them munching on an unsuspecting coral at some point. They greedily eat other things, but if you have corals, then you'll know for sure. I'll also second the question posed as to whether or not you actually saw the worm feeding on your shrimp and crabs? The fireworm, Hermodice carunculata will indeed eat these things, though.