The goal of the Soviet Union was to be more of a threat to the security of the United States. The US, at that time, had nuclear missiles in Europe that could hit the USSR. The Soviets had very few long-range missiles that could hit the US. Therefore, they wanted to put missiles in Cuba so they could have more missiles that could hit the US more quickly. They felt this would make the US feel more threatened.
The goal of the US was to prevent this from happening. Kennedy and his advisers felt that the Soviet Union would, if allowed to do this, then feel free to try to push to get more influence in the region. This would reduce the power of the US in its own backyard.