These intervals are called “perfect” because of their pure sound.
The tritone is not perfect because it of its dissonant, harsh quality.
For example, if one note is natural, the other will be also. Or if one note is sharp the other will be sharp too.
The only time this doesn’t apply is if the interval uses the notes B and F, because B to F is a tritone.