The answer is in the words of the law.
[And be it further enacted. That in all that territory ceded by France to the United States, under the name of Louisiana, which lies north of thirty-six degrees and thirty minutes north latitude, not included within the limits of the state, contemplated by this act, slavery and involuntary servitude, otherwise than in the punishment of crimes, whereof the parties shall have been duly convicted, shall be, and is hereby, forever prohibited:]
I see...
1. Lands outside of the Louisiana Purchase are not included in this law.
2. It does not say that after the territory becomes a state that a state cannot reverse its status.
3. It does not say that south of the line that slavery could never be prohibited.
4. It prohibits slavery north of the line within the Louisiana Purchase...period
So if Maine decided to become a slave state, this law would not prohibit it. If Florida decided to be a free state, this law would not have prohibited it. If Iowa had wanted to change its status to a slave state in 1847, how could the federal government prohibit it? Congress had no power over a state in this regard, and I see no mention of prohibiting any State from doing so in this law.
David