Here is the short version (it's fairly complex in reality, and I could probably write a book about it).
Basically, the insurance pays the amount of your "loss" (which you have to prove... another long and painful story). But, that payment is subject to policy limits. So, if your loss exceeds those policy limits, you are on the hook for anything above that.
In the meantime, you still owe the mortgage company as if the house was still there. We continued making payments on a non-existent house for two years (and still do).
So, when all was said and done, our loss exceeded our policy limits, so all we got was the policy limit amounts. All the money from the insurance went into the rebuild, but it wasn't enough to cover the whole thing. That's why we needed the SBA loan... to make up the difference.
On a side note, my new insurance policy provides for more coverage than it cost to rebuild. I made sure the policy limits were much higer now. To keep the premium costs about the same, I raised the deductible from $500 to $2500. So I now have 2 or 3 times the coverage for about the same monthly cost.