You don’t have to remove either. It’s done for appearance. When cooked the contents are harmless. Restaurants may remove the digestive tract from lobsters before serving, but not alway if the lobster is served whole. With lobsters the bug is usually kept alive for a while without food and the tract will be empty and not noticeable (although in females it may be full of roe). Shrimp aren’t kept that way and need to be deveined for appearance, or if to be eaten raw.