Espresso machines rely on pressure to extract coffee solutes over a very short (~25 seconds) extraction time. Tamping is a critical aspect to achieving this. By tamping ideally, you eliminate channels by which water might pass through the grounds. Elimination of those channels is important for two reasons. First, channels mean that water only touches some of the grounds but not most, meaning you get very little coffee extracted. Second, tamping evenly forces water to travel through the entire bed of grounds; this is a critically important aspect to how the machine builds pressure. If channeling is present, water will simply drip through the grounds. You will not get 9-12 bars of pressure (or anywhere near that).
Moka pots are different because they build pressure below. Water is heated in the bottom chamber where it rises to dampen the bottom layer of grounds in the basket above. Because the moka pot doesn't use a pump, it requires steam to build up to create pressure. The pot is designed with a certain volume of space between the water reservoir and the grounds basket to facilitate this. If you tamp, you create resistance that the steam pressure might not be able to penetrate--at least not without causing an explosion of grounds and forcing a lot grounds up into the top chamber and making your brew sludgy.
If a moka pot filtered the coffee, something else bad could happen if you tamp. If there were a filter above the grounds, the aforementioned upward explosion of grounds caused by excessive pressure buildup would push grounds up into the filter, clogging the filter. This could cause the filter to get clogged. Best case, a steam outlet valve lets out the excess pressure and your brew is just ruined. Worst case, the steam outlet valve could get clogged and your pot could explode. Basically, even with completely effective safety features and special filtering features, tamping a moka pot would make it impossible to achieve a consistent brew because the amount of clogging of the filter would cause pressure during brewing to vary unpredictably. This isn't a problem with espresso because with espresso, a pump pushes the water through and because the machine itself controls the temperature of the water.