I gather that this project targets internal constants.
Let's say you need to share the list of error codes between your backend API and your frontend: instead of having to maintain two lists, just share the constants between the two codebases...
Environment variables don't give static type checking or autocompletion in your IDE.
You could also do this with the C-preprocessor or CMake config files.
But a common, well-defined source language (here: yaml) should make it easy to add new backends and to adhere to language quirks (e.g., number literal formats)