I understand it’s illogical. But what your seeing is a nuance of the yaml python library (which tries to make yaml easier by strongly typing your inputs, I.E. converting inputs to the correct type). See documentation:
And then you are also seeing what was a decision made by the hass team: All ‘main’ states are strings.
I do not know why this was done and I could make guesses. I would wager that because templates (jinja) only returns strings, and user interfaces only display strings, that the logical method to store states is as a string.