The blast in West, Texas produced a yield equivalent to about a kiloton of TNT. They know this by measuring the size of the mushroom cloud. You see they did so many open air nuke tests in the 40s and 50s that there is actually a formula for this. The amount of anhydrous (dry) ammonia gas in the tanks was enough to yield 1.2 kilotons if it was all consumed in the blast.
This was 1350 times what was allowed by Federal regulations, but since the Reagan Administration it's been up to the states to enforce these sort of work place rules. We don't know yet if the massive amount of ammonia nitrate also stored on the sight played any roll in the blast, it's an oxidizer and won't explode unless mixed with fuel oil.
Texas doesn't like to interfere in the rights of business. In fact there was nothing keeping the plant or something even worse from being right in the middle of town. The only zoning restriction in Texas is how close a strip club can be to a residence, church or school.
Nuclear scale explosives? No problem, there's a vacant lot between the school and the nursing home, move right in, as long as your female workers keep their tops on. The thing about anhydrous ammonia is it's not particularly flammable, it burns at a lower temperature than its ignition point. The big concern for public safety is that you can use it to cook meth. That is it's safe as long as you follow the applicable regulations, funny how ignoring what the nanny state tells you tends to work out badly.