Why is it el agua not la agua ?
Why is it, since agua ends in an 'a' and it should be a feminine noun. For feminine nouns, I thought we should put la in front of it? And if the noun does not end in 'a' or 'o', then is it true that it is considered as a masculine noun automatically ?
It is under special rule when the substitution of el for la takes place only when it comes immediately before a singular noun that begins with a stressed a- or ha-. A few examples:
el agua (the water) el ama de casa (the housewife) el asma (asthma) el arca (the ark) el hambre (hunger) el hampa (the underworld) el arpa (the harp) el águila (the eagle)
To answer your other question:
No, gender is not assigned by default. There are patterns for recognizing gender, but most of the patterns have exceptions. The are invariable nouns that have the same form whether referring to either sex and just the definite article changes (el artista, la artista).
The only sure way to know the gender of a noun is to learn it when you learn the noun or consult a dictionary.