We all know how J'onn J'onzz came to be: he was accidentally brought to Earth by a teleportation machine created by Dr. Erdel, and after Erdel's subsequent death, was unable to return home. A few details were tweaked a bit post-Crisis, but the main idea is the same.
So, stranded on Earth, what options did J'onn J'onzz have? What was he to do with himself? Well, he took in a few of the local Earth sights and noticed that our planet is a little bit behind his:
It was then that J'onn J'onzz decided to dedicate himself to his main task. This is his "bat through the window"* moment:
And he decided to wear a hat. There was much rejoicing.
So now we know J'onn's reason for being: J'onn chose to fight crime on Earth in the hopes that one day it will be obsolete. Pretty much like Batman, he used an active decision to turn a setback into a raison d'être, and for both characters the choice easily could've been to indulge in more self-serving activities.
To look at his origin from behind the curtain, the character of John Jones, the Manhunter from Mars was created as a detective who used his Martian powers to solve crime. He was a detective who happens to be an alien, not the other way around.
*Just in case anyone doesn't know to what I'm referring: a bat flew through Bruce Wayne's window, thus inspiring him to use a bat for his symbol.