The state is here to protect you, but mostly if you choose to fight residential fires for a living.
Every day, people in certain positions of authority in government do their very best to protect you. While this may give you a sense of security, it also means removing some of your freedoms and money from your pocket. It is remarkable to me that with all of our accomplishments in attempting to create a better society, we have created a whole class of people who have a monopolistic position to control what you do with your home.
Back when the West was settled and we began building establishments that lined the streets, construction was un-regulated, and buildings were built from trees and not separated from each other. A fire in your establishment meant the possibility of whole blocks of buildings were at risk. What did a community do? We elected a fire marshal who knew about the risks that a fire would do to infrastructure and gave him the authority to inspect and approve or disapprove of anything that may cause harm to "life, health, and safety."
Fast forward to today. What is your home built out of? Mostly the same materials we built frontier buildings out of, with a few exceptions. Now we bring electricity and natural gas into these structures that, together, create the real possibility of not only destroying your home, but possibly your neighbors' houses, too. This is why the fire code was created, to eliminate any possibility of electricity getting out of control and starting a fire.
When was the last time you heard of a residential fire that completely destroyed a home and the people in it? Do we really need an (armed) fire marshal going around threatening people who are trying to make a living? Do we really need a whole class of people driving around in a $500,000 truck designed to fight fires, but mostly responding to every emergency call?
I'm not sure we have progressed very much in the last 100 years.