It’s a matter of anatomy! When any crustaceans are cooked, the muscles in the body contract. This results in that curled “U” shape you often see. To prevent this, you can stick a skewer in the shrimp (from tail to head) to hold its shape.