I'm 38, so not quite middle-aged. But, as I approach middle age, I have begun to suspect that what you are asking is true. The reasons I see are experience, wisdom and maturity.
People in their 40s and beyond have likely seen a lot and learned a lot. Their life's experiences can guide them to make better decisions. As long as they've learned from their past, and they understand how to learn from the past of others, why shouldn't life be more fun for them?
I suppose the answer here also depends on a person's definition of 'fun'.