Unfortunately, I don't believe that there is a law that prohibits this. The lender basically acts as a lienholder yet they wield significant power here because they do not have to allow the seller to sell.
My advice would be to see if you can find out from the listing agent what the highest offer is and, if possible, increase your offer so that it is higher than the highest offer.
Here in California, we have an addendum to the purchase agreement that informs buyers of the issues that you bring up. Because the listing price usually has nothing to do with what the bank is willing to allow the property to sell for and because I've had so many banks decide to foreclose even though I had the highest offer, I encourage all but my investor clients or my clients who really do not need to be certain about the property that they are placing an offer on to avoid short sales.