I know the military demands for a candidate which serves as the right fit. But looking at Forrest Gump I think one would have to think maybe thrice!!
He was not mentally challenged or something but he got low IQ:
Image copied from a Quora post covering the same concern and most of the answer there also point out the same thing. And also don't forget he got a football scholarship due to his athletic abilities os, of course, he is quite capable to serve in Army.
Here is all the requirement listed which you need to fulfill to get in the army and it's nowhere mentioned that you need high IQ or even average. So we can assume he did clear all test and got there by fair means.
The law stack exchange covers testing entry requirements for the army. The army conducts an Armed Services Vocational Aptitude Battery test, and a minimum score of 31 is required to join. This is roughly equivalent to an IQ test score of 80-91.
However, this requirement was famously lowered between 1966 and 1971. McNamara's project 100,000, despite its name, recruited between 320,000 and 354,000 additional soldiers that would have previously been rejected.
Project 100,000 soldiers included those unable to speak English, those who had low mental aptitude or minor physical impairments, and those who were slightly over or underweight. Inductees of the project died at three times the rate of other Americans serving in Vietnam.
Forrest joined the army in 1966, so the implication of the film is likely that he and Bubba were both part of this program.