We are here on earth, because God needs us.
The question 'Why are we here on earth?' can be answered in two steps:
1) First of all we will have to know as to whether there is any God or not;
2) If we can somehow come to know that there is a God, then we can further ask the question as to why he created the universe.
When we will have the answer to this question, we will also come to know as to why the universe exists, why we exist, or why we are here.
The above two have already been answered here1 and here2 respectively.