Actually, it's the first sentence that sounds okay to me. " It is not time related in this particular case. The second sentence doesn't work but can be corrected to: Tom doesn't understand why he failed his English exam into which he put so much effort.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.