United made a big mistake giving him a new contract at the end of the season. They saw how disastrous he was and they still decided to give him a new contract. They wanted to trust him and give him more time, but time was not what Ten Hag needed. He had no clear idea on what he wanted from Manchester United. He had lost the dressing room and there was no improvement from the team both individually or as a team. You don't give a manager like that more time. For a manager to deserve time, that manager has to have shown signs of improvement.
The trust was because he won trophy for them at the end of the season, so despite his poor performance, they think he can amend and make it big if they sign more players for him; they did sign the players for him as he wanted and yet he couldn’t use what the team have for a better result.
Even after the management meeting some weeks ago that made them decide leaving him as the coach, he couldn’t be consistent, he lost some games that he is supposed to win, and the set back in the Europa League was the big mess because Manchester United should have been leading the Europa League table.
It would be difficult for United to get a better manager now because the season is already on and most of the good coaches have jobs. That's why it would have been best to fire Ten Hag at the end of last season.
Another thing is, the environment at United is too toxic for both the managers and players. The club needs to improve and make sure the build an atmosphere that makes players and managers comfortable and excel.
It will be hard to get a better manager now because almost all good managers have job at hand, so getting a better manager will be hard for them, they have to manage to end this season with the caretaker manager before they confirm the perfect replacement for Ten Hag.