Should PHP Functions / Classes be used to create html script or
should it primarily be used to generate and manipulate data via php and or a database.

Generally, I create functions and classes for commonly utilized code... but not single use code.

For example: generating a list of States... could be used in different parts of an applications.

But - displaying a list of States would might only be used in 1 part of an application.

With other languages... I would create an object to retrieve the associated data and let a non-function / class display the data.

To use a CSS equivelent... CSS allows you to remove the design layer from the presentation layer.

I hope I made this question understandable