what can be done legally?
Ultimately, you can sue your insurance company. Did you really not know that?
Until then, however, there's a lot missing from your post that needs to be addressed about "what can be done legally."
First, I suggest that you don't spend the money until the issue is resolved. If you have deposited the check in your checking account, reverse the entry, so you don't write checks that bounce.
Now answer the following questions:
1 - How much was the check?
2 - How much of a "mistake" did the insurance company make?
3 - Did you get any correspondence or communication regarding the mistake prior to the stop pay? If yes, explain.
4 - Is the insurance company sending you another check, but for less money?