The reason why these instruments are transposing is because of their different lengths. The B-flat clarinet is longer than the A clarinet, which means that it produces lower pitches. The A clarinet is shorter than the B-flat clarinet, which means that it produces higher pitches.
Transposing instruments are not unique to the clarinet family. There are many other transposing instruments, such as the trumpet, the saxophone, and the trombone.