Moldings cover joints, allow buildings to move in the weather without leaking, are a way of fitting pieces together neatly. They give proportion, scale and pattern to spaces and shapes, and by emphasizing a part of the structure, direct our attention.
As far as I can remember, no one ever mentioned those ideas in school. Today I am surprised, but then I didn't know what I was missing. I did not expect to be an architect who took care of old buildings. 'Molding' was not even a word in the lexicon. In the 1960s, we were expected to express the structure of the building by showing it - I don't remember anyone in architecture school, or in my undergraduate architectural history classes discussing how to create ourselves what we saw (except by copying). We loved wonderful buildings, but we did not practice using pattern, proportion, massing, rhythm, symmetry or balance. Those ideas were not in our design tool box.