Why doesn't a wing in supersonic flow produce a shock that results in flow parallel to the leading edge?
Air needs to make way for the approaching airplane. For that, it takes the route of least resistance, which is above and below the wing. This is shown in your first picture which is valid for a supersonic leading edge. Your top view shows a different cross section through a three-dimensional shock at a much lower speed. The vector M$_2$ is wrong and does not correspond to what is really happening.
If X is in flow direction, Y is sideways and Z is down, picture 1 shows a cut in the X-Z plane for a supersonic leading edge. Picture 3 shows a cut in the X-Y plane for a subsonic leading edge. Here, air does not flow sideways but continues past the shock along the direction of the vector M$_1$.