Capitalization of nouns was introduced in Late Middleages (14th century). The first letter(s) of single words (especially religious terms like "GOtt", but not just nouns) were set in majuscules in order to emphasize these words.
Today's capitalization of all nouns was officially introduced in 17th century German. The literary critic und translator Walter Benjamin:
“Das Barock hat in die deutsche Rechtschreibung die Majuskel eingebürgert.”
Though even centuries later capitalization has not been endorsed by everybody. Jacob Grimm commented in 1854:
“den gleichverwerflichen misbrauch groszer buchstaben für das substantivum, der unserer pedantischen unart gipfel heißsen kann, habe ich […] abgeschüttelt.”
See also: