I’m not sure I’m feeling that it’s illegal, more that it’s uncertain...
Obviously the government aren’t in a position to know for definite how things will be in the summer. If they make guesses (like with Christmas) something could change nearer the time and then they are blamed for giving false hope when people have made plans.
Obviously you can choose to take the risk and book a holiday, but there’s no guarantee you’ll be able to go. ( Many of us have chosen to take the chance).
If you can’t go, you may or may not get a refund or be able to rebook depending on the terms of your contract. You may lose your money.
If you book to go abroad, there is a high chance you will have to pay for tests before you go and on return. There is also a high chance you will need to quarantine for 10 days on return, possibly in a quarantine hotel. There is a likelihood that the list of quarantine hotel countries will change, and that you need to be prepared to fund a stay in a quarantine hotel at short notice. (Even if your destination wasn’t on the list when you booked).
If you want to book a cottage or similar with a group of people who are not in your household (uk or abroad) there is a high chance you will have to cancel. You may or may not get a refund depending on the contract terms.
If you are aware of the above and happy to accept the possible consequences then of course it is ok to book a holiday!
However, if the government say this, they will still be blamed by people if the plans have to be cancelled or changed. Like the people who blame the government for the deaths of their relatives after Christmas Day mixing, like the government forced them to meet indoors....