templates are designed to sperate the functionality of your site from the display. if you mix all your functionality and html in together, if you want to change the way the site looks you'll spend forever mucking about in your code. not good.
with a template set up, you first do all the functionality you need and then load up the data you want to display into some variables. you pass said variables to the template engine and it displays your pre-built template with the passed data. very simple. if you want to change the look and feel of the site later, just change the template.
i would suggest smarty for a template engine.
http://smarty.php.net/