A judge sentenced a former New Mexico State Police officer to seven years in federal prison for possession of child pornography.