Allow me to elaborate.
Air(gases) tend to absorb and radiate heat less than solids. When trapped.
And trapped really means without much room to move around.
So in this case, an air mattress has quite a bit of room for the air to move and transfer heat. Since the ability of the ground to absorb heat is large, the warmed air hits the bottom and loses some heat. Not a large amount but way more than you seem to believe. In fact it's not much less than contact with the ground over time.
Now take the air and put it in 1000s of bubbles like a foam pad, and the air in the pad really really raises the insulative properties of the pad. The transfer of the heat to and from thousands of air bubbles back and forth to the foam material itself and the air slows the heat loss greatly (much much more than pure air).
Even blankets help,but not much, because laying on it removes most of the air and allows most of the transfer to happen as if it was just one layer.
So yes, air is insulative. When trapped in small spaces.