Why don't all commercial aircraft transmit GPS data in real time?
Most commercial aircraft transmit their GPS-based position twice per second. This is part of their Automatic Dependent Surveillance – Broadcast (ADS–B) broadcasts. The problem with providing world-wide receiver coverage for this system is that the frequency it uses only travels line via line of sight, so it won't travel past the horizon.

Providing coverage over large bodies of water would require a network of buoys, which would be quite expensive.

Another possibility is to put ADS-B receivers on satellites. This concept has been developed by (Aireon) on the Iridium Next satellite constellation. The system (66 satellites + 9 spares) became operational in 2019 and provides global coverage.