The evidence is what is established in al-Bukhari and Muslim and elsewhere: the Messenger of Allah ﷺ performed two voluntary units of prayer inside the Ka'bah. (1)
Is a prayer vowed by oath valid inside the Ka'bah? That is, if someone vows to perform two units of prayer, is it valid for him to perform them inside the Ka'bah?
We say: the author’s words contain both an explicit ruling and an implied one. We know from the explicit ruling that the obligatory prayer is not valid, and from the implied ruling that the voluntary prayer is valid. What remains is the vowed prayer.
Regarding the vowed prayer, we may say that the author’s words leave it unaddressed, since it falls under neither the obligatory prayer nor the voluntary prayer. Someone may say: we should classify it with whichever of the two it most closely resembles. If we consider that it was not made obligatory by the original ruling of the Sacred Law, but rather that the legally responsible person made it obligatory upon himself, we would say that classifying it with the voluntary prayer is closer, since the Sacred Law did not initially impose it upon him. But if we consider that the Sacred Law made it binding upon him once its cause—namely, the vow—exists, based on the Prophet’s ﷺ saying, “Whoever vows to obey Allah, let him obey Him,” (2) then we would say that it is closer to the obligatory prayer. This is why the scholars differed concerning it. (3)
Some of them said that a vowed prayer is classified with the obligatory prayer; thus, it is not valid inside the Ka'bah.