He had been reading the book for some time and reportedly saw a connection between the themes of alienation and rebellion in the novel and his own feelings. He even signed the book "Hold On" to Lennon after the shooting.
While the book itself doesn't hold any inherent connection to the crime, it became a significant symbol in the aftermath of the event.