That should not be happening since no air can enter the kidneys and therefore the air bubbles can up after the urine came out. This should not be a problem in most cases
Air bubbles in urine is usually caused by having excess protein in the urine. This excess protein can be caused by something as simple as not drinking enough water or from exercising too much. It can also be an early sign of kidney disease.
It sounds very funny. Usually air does not get trapped in the urine. It will not be easy for your doctor to detect the trapped air either. He must be bluffing.