This can be achieved using Table Rate Shipping or a code snippet like shown below:
Show only free shipping in all states except…
Show only free shipping in all states except exclusion list, hide free shipping if the customer is in one of the states listed:
Enable Shipping Methods on a per Class / Product Basis ↑ Back to Top
If you want to have more flexibility, we recommend you to use this free plugin!