La and Le
I know la is feminine and le is masculine, but why is it gender based on other nouns and words rather than "fille" and "garçon".
Just to confirm if I understand what you're asking (since it was a little unclearly worded) - is the question "why do you make a gender distinction for nouns in French other than la fille and le garçon?"
The answer is because in French, every noun has a gender. Not just the words for obviously alive things that have biological gender - every noun is either masculine or feminine, regardless of whether it's actually alive or not. For living things, the noun's gender is just its biological gender, as you'd expect; for everything else, it's mostly random. (There are a couple patterns, but get used to it just being totally random, so you'll be pleasantly surprised when you can accurately predict the gender of a handful certain words.)
And yes, it's important. You have to learn the genders of the nouns. Much of the grammar of a sentence hinges on the gender of the nouns, and native speakers will notice if you get the gender wrong. Can you still get the general idea across using the wrong gender? Yes, but you won't sound particularly educated, sort of like if you said "Those mans came and buy some banana."