Oswald was a lifelong malcontent. Angry at mainstream society. He disliked pretty much anything, and everyone associated with authority. JFK was the symbolic representative of that society as President. LHO would have assassinated Nixon, LBJ, or any other political figure who had driven by the TSBD if they had held that position at the time. I don't believe it was personal to JFK. An act of opportunity fueled by Oswald's anger and desire to make his mark.
But he was a political person, he read political material, biographies on major political figures. He had little money but subscribed to Marxist publications, followed Marxist politics, wrote about Marxism. He condemned the Soviet system as being a betrayal of real Marxism, that it had replaced a corrupt Czarist system with an even worse bureaucratic and cruel one. In other words, he compared it to true Marxism. Why would a person who wasn't a Marxist use Marxism as a guide? Robert Oswald said he and Lee had a "tacit" agreement to never discuss politics, that it was something they just didn't talk about.
WC testimony:
Representative BOGGS. He never discussed political matters with you?
Mr. OSWALD. No, sir; he did not. I would say we had a tacit agreement it was never brought up.
Representative BOGGS. By tacit, do you mean that----
Mr. OSWALD. An unspoken agreement that we never would discuss it.
Representative BOGGS. I understand. Had you arrived at this agreement because on previous occasions you had disagreed about political matters?
Mr. OSWALD. No, sir; that was not the reason. We just never discussed politics.
The idea that he never showed any favoritism towards Marxism - as he understood it - is, I think, not true.