I will tell you exactly why we template yaml.
Its the exact same reason every code base has ugly parts. And that's the evolution of complexity.
At first, you have a yaml file. No templates, no variables. Just a good old standard yaml.
Then, suddenly you need to introduce a single variable. Templating out the one variable is pretty easy, so you do it, and it's still mostly for humans to edit.
Well, now you have a yaml file and template engine already in place. So when one more thing pops up, you template it out.
8 features later, you wonder what you've done. Only, if we go back in time, each step was actually the most efficient. Introducing anything else at step 1 would be over-engineering. Introducing it anywhere else would lead to a large refactor and possible regressions.
To top it off, this is not business logic. Your devs are not touching this yaml all that much. So is it worth "fixing", probably not.
At first, you have a yaml file. No templates, no variables. Just a good old standard yaml. Then, suddenly you need to introduce a single variable. Templating out the one variable is pretty easy, so you do it, and it's still mostly for humans to edit.
Well, now you have a yaml file and template engine already in place. So when one more thing pops up, you template it out.
8 features later, you wonder what you've done. Only, if we go back in time, each step was actually the most efficient. Introducing anything else at step 1 would be over-engineering. Introducing it anywhere else would lead to a large refactor and possible regressions.
To top it off, this is not business logic. Your devs are not touching this yaml all that much. So is it worth "fixing", probably not.