It is medium to help transmit sound waves.
I like to think of it this way: you know how whales can talk to each other over many miles, but humans can only talk to each other at a distance of a few meters under most circumstances? Sound waves move very well through water, but much more slowly through air. The waves are impeded and slowed down by the air.
Therefore to enhance the capability of the ultrasound waves, a medium other than the room air is preferred. In other words, gel eliminates the air between the probe (transducer) and the skin. Thus the picture improves.