Oswald was a bit nutty and wanted to defect to the Soviets. In fact, he'd done so once before. So he killed Kennedy to try and get into the USSR's good graces.
Ruby was pissed off about the assassination and was high on Phenmatrazine, an upper. He was not rational, but wanted to "redeem" the city of Dallas.
There was an investigation, a quite thorough one. However, the results don't support the conspiracy theories, so conspiracy theorists ignore them in favor of whatever sounds more paranoid.