Why does Descartes say that the pineal gland in the center of the brain is the gateway between our physical bodies and mental spirits? Is there a problem with this theory?
Since your question is why Descartes say this, the answer is that Descartes thinks the physical world is wholly deterministic but the mental or spiritual or psychological world (see all of these as synonyms for him) is wholly free.
Or to put it another way, rationalism is a view that's committed to the freedom of reason (and reasonable subjects) but mechanism in the physical world. Here, mechanism means something like Newton's physics. Just to reiterate, Descartes' philosophy requires a gateway between the free will and the determined body. So he picks this one. As far as I know, it's not for a great reason but more for a combination of not knowing how the pineal grand works.
But the problem is that these bodies are linked to the minds that are free. Got to staple it somewhere. So Descartes picks a minor part of the body whose function was unclear at the time. In part, he does so because he's compelled by a question from the Swedish princess.
The main problem with this theory is that it makes no sense on a physical level based on current science.
In support of that theory, you might want to follow down Rick Strassman (of "The Spirit Molecule"), who thinks he has found the substance that actually mediates immersive visualization, the transition into dreams, and the experiences we have at the end of life.
He and Terrence McKenna (of "The Stoned Ape Theory") start from a premise that human intelligence results not initially from language but from this acceptance of the surreal, the process of dreaming while waking.
McKenna contends that early hominids probably used vision-altering plants in their diet to improve their perception while hunting, but the result was the development of an entire visualization system that more actively engages perception and controls attention by using the same mechanism that dreams use.
One aspect of that system is reviewing past experience on cue rather than waiting to do it in sleep. Language then comes as a way of cuing the reliving of experiences, and eventually that enables a means of communication.
From there you can argue that the 'dreaming' part of us is attached to spirit and the rest of us is just an animal.
Then the gland that actuates dreaming and is released during voluntary visualization would be what makes the connection possible. The pineal gland is not alone here, but it is the primary source of DMT, Strassman's candidate for the link to 'spirit'.
It is fun to imagine Descartes was that prescient. I doubt that, but it is still an interesting theory.