Freshair
In my opinion, people should dress in formal wear at a funeral. A sense if occasion, mark of respect should be reflected in what you wear. It's a solemn occasion. There is a common theme of asking people to dress in bright colours nowadays - where on earth has this come from?
Times change and fashion and customs change. In the late 1800s, you dressed in black for years, even for distant relations. In my childhood men wore a black armband to mark a close bereavement, often for months.
In the 21st century we do things differently, not better, not worse, just differently. Marking grief by dressing in black is no longer necessary, it is optional. I would also question why a funeral should be seen as a somen occasion.
A funeral is undoubtedly a sad occasion. Someone who those present have loved, or been fond or had them in their life in some benevolent way, such that their death causes them regret. and they wish to present at that final event that marks the end of their life.
But afterwards, most funeral's end with what we now call a Wake, a gathering at a local pub or restaurant for refreshments when we start to remember and talk about the deceased, remember them in their glory and laugh at shared memories.
This is the modern interpretation of funerals and after. As I said, not better, not worse but what best accords with the people we are now and the society we live in.