Formal events and hats go side by side for the royals.
As mentioned in the above items, the royal family members are allowed to wear hats in public during the day. Still, it was not mentioned that wearing hats is necessary for all the formal events that any royal family member attends. If you are a fan of the royal family, you must have noticed that at every formal event that Prince William and Kate Middleton attend, they are always seen elegantly wearing hats at the formal events.
It is a part of the tradition that had run in the royal blood since 1950 as before that the women and the other members were allowed to show their hairs in public. Still, after 1950, it was made a necessity to wear hats at official events and now is considered a big part of collective British living.