One of the main reasons for the disparity is the lower taxes that the aviation industry benefits from.
If you fly from Paris to Barcelona the airline not only pays no VAT, but is also exempt from kerosene tax. If you make the same journey by train, the rail company will pay an energy tax and passenger VAT. This means higher costs for the company which are usually reflected in ticket prices.
Archived version: https://archive.ph/7Zrur
Take a look at European Sleeper, no France yet though
Taking a sleeper car on a tour of Europe seems like a wonderful vacation. Spend a day in the city, get on the train overnight, wake up in the heart of a completely different city, rinse and repeat. No flight check ins, no hotels to deal with, no driving anywhere.