U.S. District Judge Joseph Laplante agreed to grant a preliminary injunction sought by immigrant-rights groups.