A few points here.
1) the U.K. has the longest standing and highest air passenger taxes anywhere in Europe. Many other european nations have recently, or are about to start charging similar taxes - Germany started last year, France starts next year. Typically the rate for a short haul economy passenger is about half that levied in the U.K. Of course, there is an argument to raise them further.
2) notwithstanding the taxes, it is a lot, lot more efficient on a financial basis to operate frequent flights for Scotland to London (or Birmingham) than trains. Not much infrastructure to pay for, and that is a key factor.
3) the sleeper is just about the least efficient way of running a passenger train service. A small capacity train, used once a day, with much higher servicing and staffing requirements than a regular train. Hence the subsidy level.
4) environmental credentials. Depending where you are going, the sleeper may not be as clean cut as you think. Clearly the lowlander is all electric, however the highlander is diesel hauled for quite a distance, and lugging several hundred tonnes of metal up Drumochter and Slochd or over Rannoch Moor does create a lot of CO2 (and other greenhouse gases, notably NOx). And because the emissions are divided by a (relatively) small number of passengers, the per passenger rate will be quite high. I’ve never seen any calculations for this, but it wouldn’t surprise me if a London - Inverness sleeper trip generated something like half the CO2 of a London - Inverness flight, per passenger.
5) Easyjet has announced that it is now offsetting all carbon from the fuel it uses for flights. Now there are differences of opinion on the efficacy of the carbon offsetting process, nevertheless at face value there is at least an argument that flying with Easyjet is carbon neutral. Other airlines may well follow suit. This makes it potentially difficult for Government to raise APD to reduce Carbon emissions, as the airlines (or at least some of them) can claim they are carbon neutral. Or, at least, more carbon neutral than the (subsidised) rail service. (The subject of another thread, perhaps).