Yeah you are right. That looks like an especially awful way to handle things. My best answer is that the the developers of phalcon are primarily back-end developers.
They also load the script tag inside of the body as well. Something that doesn't matter as much now-a-days but is considered a pretty big red flag by anyone with front end experience.
Agreed it's not a good pratice and kudos for knowing that.
I think it's just meant to be a code example.
I'm sure a pull request would gladly be accepted to change it if need be.