Just about any time a head of state travels, he has a number of VIP government people with him. At times those people go along because there are certain exchanges that take place between lateral (two or more) nation’s officials. Other times there may be a symbolic need for it. Still other times, officials may want to go and be part of an event for personal or political reasons.
In this instance the President went for obvious reasons. Top level military officials went to recognize the loss from the armed services. Addition politicians went to add credence to the level of loss that it was, and to add an additional level of respect.
It’s painful to see this, but I don’t see it as something all that out of the norm.
Hindsight is 20/20, but you can bet they will never allow so many on one plane like that again.