Why does wp_head hook my functions to the beginning of my source code?

It doesn’t. You’ve written the PHP tag incorrectly, so your code is being printed to the browser instead of being run. You have <php?. It’s supposed to be <?php.