Icon_template: vs icon:

Why is icon_template: working in cover:, but not in binary_sensor:?

      icon_template: >-
        {% if states('switch.status_tor') == 'off' %}
          mdi:garage-open
        {% else %}
          mdi:garage
        {% endif %}

This works in covers but makes a binary sensor unavailable. I have to use icon:

      icon: >-
        {% if states('switch.status_tor') == 'off' %}
          mdi:garage-open
        {% else %}
          mdi:garage
        {% endif %}