Because ATGMs aren't the only sort of exotic munition that can be gun-launched; having gun-launched anti-drone/SHORAD missiles or gun-launched drones for tanks are possible.
Again, this inflicts a severe artificial design limitation of having to fit into a 120-140mm cylinder on very expensive devices that are more suited to be launched from more specialist launchers, which may be placed on a tank or better yet a separate support vehicle. You're better off sticking a dozen of these things in a small VLS cell in the turret basket if you really need them on a tank, like some futuristic tank designs predict.
Drones of this size may well be launched by being chucked out of a hatch if for some reason you want to keep a drone taking the limited space inside a tank.
As for AA missiles, firing it out of a barrel pretty much excludes the IR guidance of most state of art missiles of this class because the seeker will see shit in terms of vision cone, if the target is within the limit of barrel elevation at all and the barrel is cold to begin with, and others need a dedicated external guidance device that will get damaged all the time on a tank. So pretty much back to laser guided ATGM, which do have basic AA capability. But then again, fun fact, modern tank guns also have a basic AA capability.
Also normal SHORAD missiles are insanely long and for a good reason, good luck loading that into the breech in a cramped tank turret, another design limitation. A Stinger is 1.52m long and pretty delicate so no bumping it on everything...
For comparison LAHAT is "just" 0.975m long, and Russian ones are something like 20cm shorter.