Yes, it's perfectly legal to exclude places from your delivery service - even if you only do so for certain goods. For example, you can't deliver glues containing certain chemicals in some areas, or cans that are larger than a certain size. As a result, McMaster-Carr does not deliver contact cement to certain Areas and States. Sure, it's discrimination, but totally legal.
So, because that law might prevent you from doing things as you do them, you can opt to not do business in that area - just like Project Gutenberg blocks Germans, because they don't want to do business in Germany after a lawsuit.