"There had to have been a reason" is fine. It is similar in meaning to there must have been a reason. The speaker or writer is speculating on something that has already happened. (The verb tense is, I think, past perfect progressive.)
Perhaps somebody else will offer an additional comment or two. In any case, that usage is perfectly fine.





