There are three main obstacles to urban camping: weather, safety and the law.
The issue with weather is adequately anticipating it and being properly equipped for it. At stake is whether or not you get a good night's sleep. Cold or wet weather probably isn't going to kill you, but it could make you miserable and keep you up all night.
Safety, however, is a much bigger concern. Here, the stakes are very high. If you don't adequately account for your own safety, you could end up being injured, losing your valuables or even losing your life.
Law is more like weather than safety. The risks are relatively low and mainly concern you not getting a good night's sleep. If you break the law by sleeping where you shouldn't, the worst that can happen under the law is to be cited or arrested, but the most likely outcome is that you will simply be woken up and told to move on.
We will discuss weather and safety later, but now let's look at the law.
Law is not something perfect and pure handed down by God. It is a flawed set of rules created by elected politicians, invariably to address the public hysteria of the moment. Law is a crude attempt to solve social problems by applying the same simple rules to everyone. Unfortunately, it is never subtle enough provide the best or most moral solution in every instance. For every problem "solved" by the law, there is almost always another one created, sometimes worse than the original.
In almost every populated area in North America, there are criminal laws against spending the night where you are not formally authorized to. You can understand why: If you build a city park, and crowds of substance abusers start sleeping there, it diminishes its function as a park. If you live in a respectable residential neighborhood, and people with nothing invested in the neighborhood start camping in a vacant lot between houses, you understandably want to evict them. If such "vagabonding" is legally allowed, then it is going to be abused. Local citizens will get angry over a few high-profile incidents, so politicians will write such laws as required to give police the tools to evict the squatters.
But merely the fact that a law exists does not mean you have to obey it. The law doesn't relieve you of your obligation to do a private analysis of the morality of your own actions. The law is not morality, only a crude caricature of morality. Some of the worst atrocities in history were committed by people "just obeying the law." That's not an excuse. You always have to think things through for yourself.
You always have a choice: obey or disobey. People don't like to think that they have this choice, because it makes life much more complicated, but they do have it, and using it is one of the greatest responsibilities of being human. Most of the time, obeying is the right thing to do, but sometimes disobeying is. The people who wrote the law never faced the exact situation you are in now, so you can't claim that the law itself is the highest authority.
What is the highest authority? It is what actually happens as a result of your actions.
Let's say I find a vacant piece of land that no one has invested anything in, and I am able to sneak in there at night, sleep for seven hours and sneak away. If I leave no trace of my visit behind, what damage have I done? To me, it's a morally neutral act: I haven't helped anyone, and I haven't hurt anyone. There may have been some minimal impact on the environment from my stay (some matted grass), but it is nothing like the impact of someone living in a big house on a hillside who drives an SUV to work every day. Have I violated the "rights" of the land owner? Maybe. But if he never knows that I have done so, the actual effects of my actions upon him are nil.
If I have a lot to gain from the action (free lodging), and I have determined within myself that the act is morally neutral, then the law itself becomes merely an obstacle, one of the factors I must consider in the cost of doing business. What are the risks of getting caught? What is the potential penalty if I am caught? These are just numbers that I plug into my internal equations when deciding whether to proceed.
If I choose my site carefully and obey my own security rules then the risks of being detected at very low. Law enforcement is generally a very passive operation. Police departments aren't actively scanning every vacant area at night looking for people sleeping there; instead, they are waiting for complaints to come in. If a complaint does arrive, then they are obligated to investigate and resolve it. My challenge, then, is to not give anyone reason to complain.
I understand the reason for the law, and I interpret it in terms of its original intent: People don't want to see homeless people in their neighborhood and don't want the damage of people living where they don't belong. I respond to the intent of the law by not being seen and causing no damage.
The penalties are also very light. Assuming that I don't sleep anywhere that is clearly marked "No Trespassing," the worst I can expect is a citation and a fine. More likely, it would just be a "You can't sleep here, move along please" verbal warning. I can handle that! The law is not going to beat the crap out of me if it stumbles upon me in the middle of the night (although "safety" might).
It has happened to me several times when sleeping in cars or RVs ("Move along, please," from a policeman or security guard) but it has happened to me only once when I was camping on the ground. I was sleeping in a tent on a perfect tropical beach on St. John in the Virgin Islands (similar to the scene above). This remote hike-in beach, which is part of a national park, was clearly posted "No camping," but since it was nighttime and I was the only one there, the risks seemed minimal. I had intended to break camp before dawn, but I overslept, and a park ranger encountered me on a morning foot patrol. She told me I couldn't camp there, wrote down my name, and let me off with a verbal warning.
In terms of the cost-to-benefit ratio, that wasn't bad at all! Keep in mind that that cheapest hotel in St. John was probably in the $200/night range. (There were also campgrounds on the island, but they were not accessible to me on foot and are usually full.) If the ranger had cited me, I probably would have had to pay a fine, but I doubt it would have been more than $200.
Would I do it again? No, I would never sleep on the beach again. It is too vulnerable and obvious. Instead, I have scouted out some campsites further inland that no ranger is likely to stumble upon.
Law-biding citizens may argue: "But what if everyone broke the law like you do? Wouldn't all social order collapse?" That's not a valid moral argument. You could also say that if everybody rode their bicycle down Main Street at exactly the same time all social order would collapse, but the fact is, it doesn't happen. I am just one person acting alone based on my unique circumstances at the time. Even the fact that I am writing about this in a public forum is unlikely to attract hordes of Free Sleepers to St. John (in part because it is usually very expensive to get there). If, by chance, hordes of vagabonds were to appear in one location, the law can handle it, because that's what the law is for: managing mass behavior.
Let me repeat that principle again: The ultimate test of morality is what actually happens (or might happen) as a result of your actions. A lawful act is not necessarily a moral one. They are two separate systems and have to be evaluated separately. Once you satisfy the moral component within yourself, then the law is something you analyze strictly for its practical impact.
In the case of Free Sleeping, the law is something you factor in just like the weather: What are the chances I will be caught in the rain, and what are the costs if I am?