The natural trumpet was limited to playing the notes of the harmonic series, which are the notes that are produced when the air column inside the instrument vibrates at its natural frequencies. The fundamental frequency of the natural trumpet is Bb, so the instrument was pitched in Bb.
When valves were added to the trumpet, they allowed players to play notes that were not part of the harmonic series. However, the instrument still retained its Bb pitch, and that is the pitch that modern Bb trumpets are tuned to.