Regression and regression tendencies are not mental illnesses generally. There is no professional medical diagnosis for "littlespace" by health professionals. The commonly referred to "Peter Pan Syndrome" may be a way of identifying "littlespace" more directly in psychology; however, it is not actually considered psychopathology (meaning in this case, an actual, studied, identified mental or behavioral disorder). Nobody can actually be clinically diagnosed on paper with Peter Pan Syndrome even and that's been a suggested syndrome for decades. It's just not a medically accepted syndrome. Anyway, moving on...
It is possible the person who's said "littlespace" is a mental illness has mistaken regression for mental deficiencies, handicaps, or challenges. Generally, these would be called "intellectual disabilities" and is due to a person being incapable of the intellectual capabilities of their peers. Intellectual disabilities would moreso include people with down syndrome or chromosomal defects (like prader-willi syndrome) and not someone who experiences genuine littlespace.
It's my general opinion that genuine littles do have the intellectual capabilities of an equal adult person. A little should be capable of determining their disinterest, stress, or feelings of inadequacy regarding performing adult tasks or responsibilities and that indicates awareness and cognitive abilities that meets that of their nonregressing peers.
We know that regression is often something someone experiences as a coping mechanism and creates a feeling of relief for the regressor. A person may need to "cope" due to current stress, trauma, mental health condition such as generalized anxiety or depression, or even childhood stress or trauma and that may very well be how regression is initially experienced for an individual who is exploring ways to de-stress. Just as any adult person develops coping mechanisms, this can certainly be one of them for a person who is still a healthy-minded individual. Regression may likely be the choice in this due to natural personality traits that make a person more comfortable with common traits we see in a biological child but, again, there are no medical studies that provide firm evidence for or against that suggestion.
What is notable is that littles often suggest that being forced to perform as a typical adult through common tasks is, in itself, very stressful and challenging to feel confident in doing on a daily basis. This would lead one to believe that they, whether aware or not, choose to cope with this through their regressive feelings and sometimes outlandish ways of appearing childlike in general behavior. Perhaps it's a trait of someone to help a peer identify them as "not the best for this particular task of responsibility". The human brain and how we subconsciously interact with other humans can be fascinating, really.
In psychology, encouraging a patient to experience regression is in effort to help them explore past memories and uncover trauma or stress that causes them to feel unstable or unhappy in some way as an adult. It's a part of someone attempting to uncover "lost memories" as well--encouraging the person to somewhat relive the days they have forgotten in effort of triggering those memories forward to explore and discuss. Though, in reference to that, it is not the same as someone experiencing true littlespace or developing into being a little. It's just a mental space encouraged through therapy.
A lot of littles suggest that regressing makes them feel safe, comfortable, and happy and that it becomes such a frequent part of that person's daily experiences that they naturally become aware that they seem to generally feel, act, and react more childlike than nonregressing adults and it becomes more of "who they are" on a base level versus "what they experience" sometimes. Some people experience this regression more consistently than others but that doesn't mean that those people have a mental or intellectual disability at all. They may have simply developed (perhaps naturally born) the little personality trait as a way to experience the world comfortably for themselves. They may be revisiting childhood experiences or feelings frequently because there is a level of understanding and comfort in those feelings or they may be experiencing these feelings as a way to recreate memories that went badly. When we talk about "being a little" we generally mean that the person feels this is an inherent quality about them at this point in their life.
Ultimately though, a little is cognitively capable of their peers and this is just another type of person just as a person may be more naturally serious, motherly, or a jokester. Littles are still human and may use their regression as a coping mechanism for actual mental health issues other humans also face such as depression, as an example. Think of yourself as more childlike in personality and cherish that as being a special part of who you are in the world. Even if you're insecure about this newfound trait of yours be happy that at least you're not more inclined to be a careless meanie buttons!