A federal judge sentenced a Woodbridge man to 40 years in prison for sexually exploiting minors and possessing child sexual abuse material.