Is there anything wrong health wise with being a 40 year old male virgin?

There is nothing wrong to be a virgin. It is a sign of purity and a dignified person.

Personally I think if you mean 'mentally health wise', then yes for some people it could cause them to go insane. For others it would be fine. If you wanted to have sex since 25 years ago and still haven't had it, well, I don't know how you could keep telling yourself it's OK, 'UNLESS' you truly believed it was.