Homeless encampments known as "tent cities" are popping up across the country.

Formed as an alternative to shelters and street-living, these makeshift communities are often set up off of highways, under bridges and in the woods. Some have "mayors" who determine the rules of the camp and who can and can't join, others are a free-for-all. Some are overflowing with trash, old food, human waste and drug paraphernalia, others are relatively clean and drug-free.

The National Law Center on Homelessness & Poverty documented media accounts of tent cities between 2008 and 2013, and estimated that there are more than 100 tent communities in the United States -- and it says the encampments are on the rise.

"[T]here have been increasing reports of homeless encampments emerging in communities across the country, primarily in urban and suburban areas and spanning states as diverse as Hawaii, Alaska, California, and Connecticut," the organization's study states.

Related: Camden shuts down its tent cities

Tent cities are most common in areas where shelter space is scarce or housing unaffordable. Yet, many people say they choose to live in a tent even when shelter is an option. And they do so for one big reason: freedom.

Shelters typically have strict rules: many require guests to check in and out at certain times that can conflict with work schedules and they often don't allow couples to stay together. Drug and alcohol use is also prohibited, and some people don't qualify for the subsidies they need to stay in a shelter because of a prior jail time (for certain crimes), or other reasons.

"Shelter is one step away from jail," said Dave, who lived in a tent city in Camden, N.J., that CNNMoney visited.

Related: Counting the homeless in America's poorest city

Another resident of the same camp, Mike, said the only work he has been able to find is part-time road maintenance, which takes place at night. Because the shelters in the area would have required him to be inside by a certain time, like 10 p.m., staying there wasn't an option. Setting up his own tent in the woods gave him the freedom to come and go as he pleased.

Some residents also view tent cities as safer than shelters because they say there's more of a sense of community.

As these encampments continue to spread, public officials are responding in different ways.

The NLCHP found that of the more than 100 camps, only eight were actually considered legal. Ten tent cities weren't officially recognized, but the city or county wasn't doing anything to get rid of them. The vast majority of encampments, however, have been shut down and occupants have been evicted.

Related: Homeless and living in Camden, N.J.

One of the most recent evictions took place in Camden, N.J., this week, when the state, county and city joined forces to shut down multiple tent cities and kick out the residents. While the county worked with the occupants to find them somewhere to go, Camden's shelters were already full and many people ended up on the streets.

Instead of evicting people from tent cities, the NLCHP says the root of the issue -- unaffordable housing -- needs to be addressed.

"Encampments and tent cities have emerged as a means of self-help for homeless individuals to survive and find shelter, safety and a sense of community," the report states. "Ultimately, the solution to the proliferation of encampments across the United States is the provision of affordable housing."