The state follows Washington state in enacting legislation prohibiting a practice that lawmakers claim leads to food deserts.