if Khrushchev had missiles on Cuba, he could agree to remove them in return for some American concessions
To test the USA:
The USSR wanted to see how strong the USA really was - whether they would back off or face up
To trap the USA:
Khrushchev wanted the Americans to find the nuclear missile sites and be drawn into a nuclear war
To close the missile gap:
Khrushchev was concerned about the missile gap between the USSR and the USA that he thought that with the missiles on Cuba it was less likely that the USA would ever launch a first strike against the USSR
To defend Cuba:
Cuba was the only communist state in the western hemisphere and it had willingly become communist rather than as a result of an invasion. Just by existing, Castro's Cuba was excellent propaganda for the USSR.
To strengthen his own position in the USSR:
With the missiles on Cuba, Khrushchev could show that the USSR was a nuclear power