Within their legal rights? Definitely. Way to get repeat business? NO!
And only a set of useless dimwits with no idea of what customers can do when choosing an airline would do it.
Many, many years ago, when company directors flew First Class in our company, BA did something similar on a F class flight to Hong Kong to the sales and marketing guy. The result was that they lost his business - usually 2 F class a year to the Far East, 4 F class to California and one F class to Sydney. Figure how much they lost by being silly and mean! Plus his sales guys no longer flew BA.