The short answer: the United States won Puerto Rico in a war.
From the landing of Columbus in 1492 until 1898, Puerto Rico was a colony of Spain. In 1898, Spain lost the Spanish-American war and gave Puerto Rico and Guam to the United States. Cuba was made a protectorate of the U.S., and the U.S. bought the Philippines.
Cuba and the Philippines became independent countries. Puerto Rico became a territory, as did Guam, and in 1917, the people of Puerto Rico were granted U.S. citizenship as residents of an unincorporated territory of the United States.
This sounds strange to modern ears, but nations in Europe fought wars over land throughout the period during which Spain owned Puerto Rico (and before and after), changing the borders of Europe over and over.
The United States was a young country, and there were some who thought she should be an imperialist power like England or Spain. Luis Muñoz Rivera, the Resident Commissioner of Puerto Rico at the time, argued against this position. Seeing that Cuba and Panama had gained independence and the Philippines was on its way to doing so, he said, “Give us our independence and you will stand before humanity as the greatest of the great, that which neither Greece nor Rome nor England ever were, a great creator of new nationalities and a great liberator of oppressed peoples.”
Puerto Rico was not given independence. Nor was Puerto Rico given statehood, for which Muñoz Rivera also asked. “Give us statehood and your glorious citizenship will be welcome to us and to our children,” he said in the same speech quoted above. Instead, Puerto Rico has remained a territory for more than a century.
In 2012 and again in 2017, Puerto Rico’s voters chose statehood. The current U.S. Congress has the option of confirming their vote and awarding statehood to Puerto Rico, or of continuing to hold a territory left over from that brief imperial dream.