I'm not really sure the risk behavioral difference castration would cause animals. Though a dog won't try to hump everything in sight after, so maybe that helps?
But in terms of human longevity between sexes, I agree it's likely multifactorial. Like men are more likely to engage in riskier behaviors or jobs and tend to smoke more. But there's also some hormonal component at play. Particularly estrogen stores fat more subcutaneous vs visceral and also has a protective component against cholesterol and increases disease immunity. Conversely, due to the last point, it also contributes to autoimmune conditions which is why women have them at a much higher rate.
So anyway, yes. It's likely complex and to what degree hormones vs behavior vs environment play a role, no one really knows.