There are lots of different views on this.
Some states have requirements that guns be secured so children can't be injured by them. (The infamous "trigger lock" is a typical, low-cost way of complying with this, I think.)
Many believe in the "nightstand gun", so it is ready in an instant.
If you have a large or expensive gun collection, you're worried about loss due to theft or fire.
Personally, I have nephews visiting just often enough to have all guns locked up, even though my state doesn't have a law specifically requiring this. I'm also worried about arming a criminal, should he get one or more of my guns as a result of a successful burglary. Though I have only a few, they're locked up in a steel chest (Treadlok).
To handle the "in an instant" problem, I also have a Phoenix "between the studs" safe with a keypad lock, where we keep a couple of loaded pistols.
There are many, many different ways to secure firearms. Do I believe they should be in an unlocked closet? No. I believe that gun owners who do that are going to regret it, eventually.