Grammar and spelling is important, I won't deny that; they are rather like a first impression - what would you first think of someone if they were dirty and wearing rags? On the other hand, if that person speaks up and says intelligent, meaningful things, would your impression about them change?
Grammar and spelling are superficial; it's really the content that counts. I've read incredibly long essays that say very little and therefore they get very low marks. I've read short essays, sometimes much shorter than what was assigned, that had phenomenal things to say and therefore they received high marks. Content is important.
Here is my advice to you:
Before you start writing, do some brainstorming and jot down some ideas, keeping in mind why you are writing this essay and who your audience is. Better yet, make up an outline. Nearly every student who does this will end up getting a better mark, guaranteed.
Make a rough draft. This means that you start writing and avoid stopping to check spelling or grammar (instead, underline or put stars by those words or sentences you want to check later). Stopping writing only disrupts your thought process so just keep writing! It took me a great deal of time to figure this out; don't make the same mistake I did.
Edit. Check out all those things you underlined or starred. Read the essay out loud to see what flows and what doesn't flow. Don't be afraid to move sentences or paragraphs around. Try reading the first and last sentences in each paragraph all the way through the essay; you should be able to know what the essay is about by doing that. Make sure you aren't saying the same thing over and over again - remember, content is important and repeating yourself isn't adding anything new to your essay. Ensure you are always backing up what you are saying - keep asking yourself "why" about each statement you make until you can't ask "why" anymore. Avoid cliches and don't overuse quotations; your audience wants to read what you have to say, not what someone else says.
Repeat step 3. Get someone else to read it over; find out what they liked, what they didn't like, and where you could improve things. Try using this handy checklist.
Repeat step 4. In fact, repeat as often as necessary.
Type it up or write in neatly. Give it a name that captures the attention of the reader but explains what the essay is about.
Here are some other sites to check out:
How to Write an Essay
Shows one how to make an outline. Has some very good tips regarding how to write well.