The United States built federal immigration centers during the Gilded Age to process and regulate the increasing number of immigrants coming into the country, and to limit the number of immigrants entering the country. Therefore, the correct answer is D.
During the Gilded Age, which took place in the late 19th and early 20th centuries, there was a massive influx of immigrants from various countries, including Italy, Ireland, and Eastern Europe. The government established immigration centers such as Ellis Island in New York City to process and screen these immigrants, and to limit the number of people who could enter the country.
The centers were designed to enforce immigration laws and exclude certain groups of people, such as those deemed "undesirable" due to their nationality or health status. Immigrants had to pass medical and legal inspections at these centers before they could be admitted to the country.
Therefore, the primary purpose of building federal immigration centers during the Gilded Age was to limit the number of immigrants entering the country, and to regulate and control the flow of immigration to the United States.