Judge John McConnell granted the request for a preliminary injunction from nearly two dozen Democratic states.