Why are the pitot tubes on supersonic combat aircraft so long?
The length is not needed for supersonic flight, but for subsonic flight at high angles of attack. Due to the high wing sweep, a high angle of attack capability just happens to coincide with supersonic configurations.

In subsonic flow the air ahead of the aircraft is influenced by the aircraft's pressure field, and at high angles of attack and high wing loadings this reaches out quite a bit. The pitot tube can only measure total pressure when it points into the flow direction. Ahead of the aircraft, the local flow angle increases the closer you are to the aircraft, and this increases measurement errors, because now the pitot tube sits at an oblique angle to the airflow. A longer pitot tube reaches farther out into still relatively undisturbed flow, so less compensation is needed to arrive at good values for total and static pressure. In early flight test, the pitot tube is much longer again, because the compensation factors are not yet established.