Why is it that hospitals consider hernia repair "cosmetic surgery"?

Not Cosmetic. Hernia repair should not be considered “cosmetic surgery”; consequences of incarceration or strangulation of a hernia can be quite serious. I would suggest that you make sure that there has not been some type of miscommunication.
Hernia. Any hernia, large or small can become strangulated. In this situation a portion the intestine which is trapped within the hernia is strangled and its blood supply is cut off. Losing its blood supply the intestine becomes gangrenous and then ruptures. Ruptured intestine is as bad or worse as a ruptured appendix and requires emergency surgery.
Blame insurance. It's not then hospitals but the insurance companies that set the rules.