Lula was caught on a recorded line speaking with the current president about his legal issues. On these recorded calls they converse about Brazil's protectionist laws for government employees. If he were to be on the government payroll, he could not be investigated by traditional measures, but rather the supreme court. After appointing judges in his previous administration I am sure he thinks his chances are better going through that system.
Having served adequate terms, a president should cease operation in such high roles as cabinet in order to eliminate possible corruption. While no evidence is shown backing the corruption, as the President remains free of the shield of the cabinet, he will still remain subject to investigation if indictment occurs in the future.
Luiz Inacio Lula da Silva is the former President of Brazil. Of course he knows how the government works and its loopholes. He had corruption scandals during his presidency so I wouldn't put it past him that he would attempt to evade prosecution by any means necessary. I guess he was just hoping that no one noticed what he was trying to do.
Of course, the appointment was an attempt to avoid prosecution, because politicians are corrupt. History has shown again and again that politicians not only commit crimes, but that they will do anything they think will work in order to get away with their bad acts. This person saw an opportunity to save themselves, and they took it. It's hardly surprising, and it was correct to block the appointment.