Generally it's the bit.
It's the horse's way to express discomfort or pain.
To check, take off any nose bands and ride, if he opens his mouth and is all over the place, you have the answer, and something you need to work on.
Pressure from their bit in their mouths is obviously uncomfortable so a lot of horses stuck their tongues out to avoid the pressure or relieve it. Keeping the nose band loose and soft hands teaching them to soften their jaw and understand that they have no need to put their tongue out can help. Some just have a habit or horse problem like Brenna said
It can be a teeth problem, a bit problem... Maybe the bit doesn't correspond to him and he has a problem that he is trying to reduce by keeping his tongue out. Try to ride him once with a halter to see if there's a difference and be sure if it's the bit or no. It also can be a back problem. I also know some horses are pretty weird and have fun when keeping it out, I know one like that!