The ruling follows a lawsuit filed last week by twelve states, led by California