What Cuba hoped to achieve in the Cuban Missile Crisis was a closer relationship with the Soviet Union.
In 1962, Fidel Castro's revolution in Cuba was still young. Castro's Cuba was not economically or militarily strong enough to stand on its own, particularly with a hostile United States so near. The Bay of Pigs invasion had convinced Castro that he was in danger from the United States. Accordingly, he wanted a closer relationship with a country that could help Cuba strengthen its defenses and its economy.
When Khrushchev proposed putting missiles in Cuba, then, Castro was in no position to say no. In fact, he welcomed the idea and preferred that it be done openly. However, the Soviets insisted on secrecy and Castro went along with that.