The reasoning is simple … it is directly quoted in the New Testament by Jude (vv.14-15) and themes of the book referenced in 2 Peter 2:1. Also, the first 36 chapters have been considered Scripture in the Ethiopic Coptic Church (a church who ascribes their founder as the Apostle John).
(Doubting Thomas, Caravaggio, 1602, Pushkin Musem, Moscow)
Thomas is a figure of intrigue and mystery. Only one Gospel, that of John, really relates anything particular concerning Thomas, the rest is left to our intimation.