Por qué tenía

why … had

→ por
phrase Common #7,891
why … had Often followed by «que» plus an infinitive to mean “why … had to.”
SP: ¿Por qué tenía que irse tan pronto?
EN: Why did he have to leave so soon?