Grammatical genders are merely a system of categorizing nouns. While grammatical and biological gender often coincide, it is not always necessary that they do. For example objects that are not people or animals do not have biological gender, so it is merely the words used to describe them that have gender, not the objects themselves.
It is important to know the gender of nouns because the 
articles and 
adjectives used with them inflect based on their gender. This is called 
gender agreement. For example, feminine nouns require that articles used with them be in the feminine form.