I'm not sure what you're talking about with respect to Ubercart unless you mean there are database administered state restrictions for one of its various shipping plugins. In Commerce, though, you control shipping service availability on a service by service basis using Rules. This means if you define your own flat rates through Commerce Flat Rate, you can add conditions so only certain flat rates appear at certain times (like "Free shipping" only showing up for orders over $100). If you're using a module like Commerce UPS or USPS that define those carriers' various services, then you can put conditions on each service's Rules component that check the state before making the service available.
To restrict the calculation of shipping rates for an entire shipping method like this (e.g. Flat rate, UPS, USPS), each shipping method has a default Rule that you can add conditions to. I think this is what you'll need, and you can use a set of "Order address component comparison" conditions to ensure items aren't shipped to the wrong state. Additionally, you should configure the "Shipping service" checkout pane to not allow checkout to proceed without a valid shipping service being selected.
I'd recommend conditions that check that the country is US and that the state is not AK or HI. That'll be much faster than checking to make sure it is one of the 48 states.
Comments
For this you have to add two conditions (one for Alaska and one for Hawaii). Set the operator to equals and the values to HI for one and AK for the other. You will then have to NEGATE the condition.