You could even install first-class plane beds in standard on a train and probably fit enough on to make it economically viable.
Yes, screaming babies might be an issue, but there's always the option of a family coach (or family-free) coach to solve that. I use ear plugs on a plane when I want to sleep, so that's not a massive deal anyway.
Trains are bigger (longer) than planes, so have many advantages. A 2 hour flight from London to Barcelona is fine, but if I need to be there for 9 or 10am, that means flying at 6 or 7 am (and that has to account for landing and getting to the gate, collecting my bags, clearing passport control [which could, possibly, be done before leaving St Pancras] and getting into town from the airport). The first train from Hatfield goes about 4.15am, the next almost an hour later and it's unlikely I'll make it to check in and clear security.
So, I get a taxi (£30+) and have to hope it turns up on time, or book it stupidly early so I get no sleep at all, or go the night before and book a hotel. £100-£150 thank you very much, plus the cost of getting to the airport that I'd still have to pay.
Or I fly the night before, perhaps going straight from work. That's the best option, but if I finish at 6pm then I might not be able to fly until 9-9.30pm. That's an arrival of midnight local time or thereabouts. Now I need another taxi or hotel stay.
Frankly, to leave work at 6pm and be on a train on or before 11pm, that arrives around 9-10am in Barcelona central station, with my bags with me and no passport control to worry about - and the benefit of Wi-Fi and 3G/4G coverage for the trip - makes this option perfectly viable and only a totally stupid cost would make me consider the flight options instead.
Sure, I can accept some people live close to an airport or want to go to somewhere that's nearer the destination airport. Not everyone is near St Pancras.. I get all of that. I'm close to Luton, and not far from Heathrow or Stansted - and by train, Gatwick is easy to get to too. But St Pancras is also easiest of all, and most of the time I go abroad I am going to the city centre, NOT the airport.