The water management issue is a bigger deal in some locations.
In the original post, he's sloped the new roof back towards the house - huge issue where I live (Atlanta - we got a lot of heavy rain) since that's going to cause water entry in the basement or erosion on the foundation.
It can also be a fire hazard in many situations. Ex - in my area there's a mandated 10ft gap between the property line and any structure. It's there to prevent people from building right up to the property line, essentially creating townhomes, but with none of the fire/safety planning those require.
All that said - I agree with you, this code is likely there to discourage people trying to skirt around inspections (and because it's easy to spot).