Miss
The rational behind why a detached vs not detached is complex, sort of.
1. Life Safety from Fire, and decreasing the likely hood of progressive fire spread, and starts.
2. Life Safety from Structure, (perceived life safety) i.e risk to the public and to the state. Your home is an asset of the state, they are obligated to help you protect yourself, and others. Therefore, most countries have building regulations and enforcement, as failures may result in death. Which normally get's people's attention. Have an engineer come in and review the work, upgrade that interior construction, so that the likelihood of fire spread is reduced to the acceptable local levels, or the minimum national level whichever is stricter. Now some countries, all former commonwealths ones i believe some level of building code. Sometimes contained within this is a recipe book for how to create or achieve a purpose. Sometime this is thaw shall do this.
3. There are tax issues, and ownership/ sub dividing issues. Your country may have on the books a law, that allows a tenant which has purchased ownership of a building that was separate, from the land, as the land the city would not allowed sub-divided and you were required to sue for the right of selling a portion of your land rights.
The explanation for number 1, is that we would rather not have many many buildings on fire from a single source, that is alot of unhappy people, economic lost, environmentally unfriendly, high risk of loss of life during the event. In the pass when this was uncontrolled, when there was a fire blocks of buildings were lost, subdivision.
4. This one is opinion based, however i find that people also like to have a little bit of control on what something is going to look like, as a result that's sometime there are restriction on how things can look/ appearance. Sometimes it's keeping history intact, sometimes we want a setback for traffic obstruction prevention.
We live in a world where we all interact and influence or effect eachother. Just be mindful of that.