これってなんで完了形つかうんですか? ⇒ 以下の様に考えてください。
I am(現在形) ashamed of not [having been]<完了動名詞> diligent while I was(過去形) a college student.
= I am(現在形) ashamed that I [was](過去形) not diligent while I was(過去形) a college student.
※考え方:完了動名詞は、その前にある動詞amの時制(現在形)よりも前の時制=過去形を表す
「when」ではなく「while」だから、完了形なのかなーと思いました。そういう訳でもないんでしょうか。→ when ≒ while ですので、差はないと考える方が良いと思います。
例えば、「私は大学生の時勤勉ではなかった」という文だと、
〇I was not diligent when I was a college student.
〇I had not been diligent while I was a college student.こういう訳ではないんですか?
⇒ 〇と✕です。
〇I was(過去形) not diligent when I was(過去形) a college student.
✕I had not been diligent while I was a college student.→ I was(過去形) not diligent while I was(過去形) a college student. ※when ≒ while<ほとんど同じ>
参照:〇I had not been diligent until I became a college student.大学生になるまでは私は勤勉でなかった。
参考にしてください。