I want to add a perverted character to my story (don't ask why), a bit like Master Roshi from Dragon Ball or Minoru Mineta from My Hero Academia. However, I want to make them more sympathetic and give an actual reason as to why they are such perverts, not to justify their behavior, but to show them in a different, more tragic, light. You know, instead of just comedy relief.
Side note: just like in the examples I listed above, the pervert is punished almost instantly whenever they do something perverted. Nobody except other perverts encourage their behavior.
How could I do this? One idea I had would be to have them think they are unattractive, thus they're simply perverts because they know they have no chance with any of the girls anyway.