Sideways walking is not a design flaw in crabs; it is the least bad compromise for life under air and gravity. A crab’s exoskeleton is rigid, its body wide, its joints hinged so the long walking legs swing best to the side. Try pushing that bulky frame forward on land and each step would pitch the body, strain the joint angles and waste energy.
Underwater, the same hardware gets a new rulebook. Buoyancy cancels much of the load on the exoskeleton, and water resistance rewards broad, sweeping strokes over tiny precise steps. Those laterally oriented legs, powered by muscles anchored to the carapace and coordinated by the central nervous system, now behave like rowing oars: a power stroke with high drag, a quick recovery stroke with reduced drag. That is classic unsteady hydrodynamics at work.
The surprise is that straight-line bursts are actually the easiest option once drag and thrust line up. Lift from flattened leg segments helps keep the body trimmed, so the crab can channel force almost directly along its midline instead of wobbling side to side. On sand, friction and body weight punish that posture. In water, the same anatomy flips into a compact, jet-like escape system, built not by retooling legs but by switching the medium they push against.