The man convicted of attempting to hold former Speaker Nancy Pelosi hostage and attacking her husband with a hammer two years ago apologized in federal court Tuesday, but still received 30 years in prison at an unusual resentencing hearing that resulted from judicial error.