This is true, and if someone (government) is mucking up the free market for insurance, it will cause these kinds of problems.
However, insurance companies have an additional problem. They need to spread out their risks, so that no single disaster can affect too large a portion of their client base. This is probably the problem here. Allstate may have too much market penetration in New Jersey.
Of course, there's another way around this problem, it's called reinsurance. That's where an insurance company, that insures other insurance companies, takes on a targeted portion of the risk, to mitigate exactly this kind of problem.
I wonder why Allstate isn't just getting reinsurance for some portion of their home portfolio in New Jersey. Probably government interference.
Spread out the risk and reinsurance are the traditional models. Now insurance companies also like to cherry pick their customers.