Allowing to define state color for template sensors

Not saying this will never happen but in my opinion it is unlikely.

Home Assistant has a well defined separation between backend (e.g. integration configuration) and frontend (e.g. dashboards and cards).

You have just mixed the two.

A better way to approach this would be to ask for this configuration in card configs rather than the sensor config. Or just vote for this as the request already exists: Entity Icon color & custom icon color based on state (customise icon_color)