The short answer to this question is that yes, it is cruel to cook shellfish and crustaceans alive, because although they have less extensive nervous systems than humans do, they still feel pain. This has been a subject of vigorous debate, as the animal rights movement feels that cooking shellfish alive is inhumane, and several scientific studies on the topic have come up with inconclusive results. Fortunately, there are ways to humanely cook crustaceans and, to some extent, shellfish as well, for consumers who would prefer more humanely killed seafood. Consumers concerned about cruelty to food animals may also want to consider purchasing free farmed, humanely raised meat and animal products.
Many consumers ask why they are encouraged to purchase shellfish while it is alive in the first place, as all seafood buying guides remind consumers to buy live shellfish and crustaceans, not dead ones. The reason for this is that dead shellfish tends to spoil very rapidly, and if you do not know how long it has been dead, it is hard to know whether or not it is safe to eat. For this reason, consumers worried about food poisoning should purchase shellfish while it is still alive, and make sure that it is alive shortly before cooking. Consumers should also store shellfish with care; do not leave shellfish wrapped up in butcher paper, because this does not allow body fluids to drain. To store shellfish safely, use a slotted drainage container over a tray to catch the water, and rinse them occasionally.
As anyone who has cooked crustaceans knows, they clearly feel what is happening to them as they are cooked, because they tend to struggle when being placed into a pot and for several seconds afterwards. They may also continue to twitch and appear to move for several seconds after death due to residual nervous system signals. Shellfish may not exhibit noticeable signs of distress, but they probably feel some pain. You can reduce the suffering of shellfish during cooking by freezing them first for approximately 15 minutes, and remember to cook shellfish in a tray above the water, not submerged in it.
If you want to cook crustaceans humanely, start by freezing them for around 15 minutes. This will not kill them, but it will numb their nervous systems, much like shocking cows before slaughter is supposed to do. Next, place the crustacean back down on a cutting board. Because it is frozen, it will move sluggishly, making the next part of this operation safer and more accurate. Keep one hand on the tail, and use the other to position a heavy chef's knife slightly above the middle of the lobster's torso, with the blade facing towards the head. Use a single sharp movement to chop the lobster in half from mid-torso to head, killing it instantly, and then throw it into a pot of salt water for cooking.