What was the Purpose of the Korean War?

The Korean War was basically another attempt to stop the spread of communism. The North Koreans had invaded South Korea and attempted to impose their ideals on them.