Tywin treated Jaime much better than Tyrion and probably Cersei. Jaime joined the Kingsguard because he thought Cersei would marry Rhaegar, that way they'd be together. It was not to spite Tywin; Aerys accepted Jaime to spite Tywin and rob him of his heir.