IMO grammatical gender in Indo European languages (of which the Germanic and Romance language families are a part of) reflect how nouns and their references (pronouns, adjectives etc) are semantically linked by modifying the word endings of the latter to better reflect those of the original noun - I like to think of it as the equivalent of type suffixes in assembly language.