Military

Why cant people with mental illness join the military? I know this probably isn't the right group but I'm so curious. I have a mental illness and I wanted to join the military as a nurse and my mom was like "they're not going to except you in the military ."