How did the U.S. acquire Puerto Rico, Guam, and the Philippines?
They were acquired at gunpoint during the Spanish-American War.
It's hard to defend the United States' conduct of the naked land grab that was the Spanish-American War. The US, having expanded to the Pacific some years earlier, needed more land and cheap labor to remain prosperous, and the major land masses that would satisfy the requirements were Cuba and the Philippines, both owned at the time by Spain.
Spain had historically been a great naval and colonial power, but by 1898 it had lost nearly all its traction in both respects. The McKinley administration really wanted to avoid a war, but the newspaper chains owned by Pulitzer and Hearst chummed the waters of public opinion and made a boiler mishap on the USS Maine into some dark conspiracy of evil Spanish treachery,
Anyway, the war lasted from April to August 1898. It resulted in America's temporary stewardship of Cuba and the Philippines, and permanent ownership of Puerto Rico and Guam.