Why Was Moriarty in a Cell?
Although Moriarty Did a Lot of Things That Should Have Sent Him to Prison, He Was Too Smart to Let That Happen, So Mycroft Sending Him to Prison for Something...
Although Moriarty did a lot of things that should have sent him to prison, he was too smart to let that happen, so Mycroft sending him to prison for something he did seems unlikely – what's very possible, however, is that Moriarty let himself be captured, just like he did in season 3's finale “The Reichenbach Fall”.
Why was Moriarty obsessed with Sherlock?
His obsession with Sherlock Holmes was rooted in how, as mentioned above, he's the only one at his same level of genius, thus representing a challenge to him: he made up all types of crimes and riddles, and then sat back to watch how Sherlock solved them.
What mental illness does Moriarty have?
Moriarty's condition would be described in modern psychiatric terms as: psychopathic/severe personality disorder (more on this later).