In theme development, are there functions which write HTML in a standard fashion to reduce “spaghetti code”?

There are specific functions like wp_list_categories() and wp_list_pages() along with some others which will do this for you but for arbitrary arrays, WordPress doesn’t have a function to neatly print it out into HTML for you. You could simply write your own functions for this purpose if you really need to I guess.