why did dinosaurs evolve earlier than humans?

All kinds of species have evolved over the course of history. 99% of all species that have ever lived are now extinct. No one knows exactly why an intelligent species like humans didn't evolve earlier. Perhaps the circumstances that killed the dinosaurs small, furry creatures like the first mammals. Perhaps these harsh conditions also selected for intelligence. Or perhaps it was sheer chance that traits like opposable thumbs and language did not evolve until humans came along.

Contrary to what the previous answerer said, dinosaurs are now thought to have been warm-blooded. Although they resembled reptiles in many ways, their bone structures and some clues we have been able to pick up about their lifestyle implies that they were in fact warm-blooded like birds and mammals. They were certainly of a different lineage than modern cold-blooded reptiles.

So the answer is really, no one knows for sure. Mutations tend to be random and we don't know enough to know why a certain trait might prevail at one time and not another. But it seems like the harsh conditions that killed the dinosaurs might have given mammals a competitive edge over the larger species that had previously dominated the Earth, and ultimately paved the way for primates and humans.