A Charlottesville judge on Tuesday sentenced Joshua Peter Gomes, a man who broke into the University of Virginia registrar’s office to alter his law school transcript, to 10 years of good behavior.