As others have pointed out, SOFIA does exactly this. The USAF has done some work with airborne telescopes. I believe the US Navy has as well. I can only assume the Russians did during the years of the Soviet Union and perhaps continue to do so. Not sure about anyone else.
Why the military? For imaging satellites and the like.
For the most part, airborne telescopes aren't worth the cost or trouble. That's not to say they never are, but there's some big hurdles to overcome. You have to provide an ultra-stable platform that compensates for all motion and vibration (I'm guessing they use strong gyroscopes for this), and cut a hole in the roof of the plane for it to stick out of (because using a window will screw with your image quality). Then you have to have a plane that can fly high enough for long enough to make it worthwhile. And THEN, you only get a limited amount of use out of it. Add to the cost of building and maintaining the telescope the cost of modifying and maintaining a jet aircraft, costs which are non-trivial, and then take into account the fact you can't realistically carry all that large a telescope this way... it's just very impractical.
SOFIA does some amazing things, but it is also very limited and specialized for those things. Even then, it doesn't get anywhere near high enough to avoid all of the atmospheric filtering of IR energy.
For non-infrared observing, just dealing with the atmosphere, it's MUCH more cost-effective to construct a large telescope on top of a mountain where the air is much thinner and steadier, and then using active optics to enhance image quality. And then, because these kinds of telescopes are used for photographic observation as opposed to active visual, you can further make use of speckle interferometry to further enhance the detail captured.
So, yes, it's possible, just not effective, to mount telescopes in aircraft.