The Missouri Compromise was an agreement between the North and South. As part of the agreement, Maine became a free state, while Missouri became a slave state.
This allowed the balance between free and slave state representation in the Senate to remain.
Also, slavery was prohibited north of the 36°30 parallel line.