How could this incident have been avoided? Well, it couldn't, because no law enforcement agency has jurisdiction regarding explosives storage security. They have this:
US Code TITLE 18, Part I, Ch. 40, §842:
(j) It shall be unlawful for any person to store any explosive material in a manner not in conformity with regulations promulgated by the Attorney General. In promulgating such regulations, the Attorney General shall take into consideration the class, type, and quantity of explosive materials to be stored, as well as the standards of safety and security recognized in the explosives industry.[Source]
The ATF is the chief enforcement agency responsible (in typical bureaucratically mangled fashion) for the oversight of explosives transactions and storage in the United States that are not subject to interstate commerce (that's the FBI) or are sent by mail (that's the United Postal Inspector's Office). But they can only do their jobs according to what regulations the Attorney General's office promotes. If Anthony Gonzalez gets his ducks in a row, then the ATF could start securing explosives storage facilities in America that house weapons of mass destruction. The GAO published a report two months ago called "Thefts of Explosives from State and Local Government Storage Facilities Are Few but May Be Underreported". The report itself is really quite good - I encourage you to read it.