Sort products by category field value
This doesn't work out of the box with Craft as the category field is a relation field.

However you should be able to use SuperSort plugin.

{% set products = craft.commerce.products.type('coins').limit(null) %}
{% set orderedProducts = products | supersort('sortAs', '{stateCat.first.stateImportance}' %}