Why do many ultrasonic sensors have specific frequencies (48 kHz & 58 kHz)?
The frequency is specific to the sensor because they are designed to have a mechanical resonance at that frequency. Similarly, audio transducers often have a specific frequency at which they are loudest (eg. 2kHz).
As to the choice of frequency, attenuation goes up with frequency (bad) as ability to discriminate distance (and minimum distance for a given Q) improves (good). Ambient noise is less of an issue at relatively high frequencies. Having the frequency well above the range of human hearing makes it less annoying. So it's a trade-off.
Early applications of ultrasonic ranging and communication tended to use 38-50kHz (eg. Polaroid SX-70 sonar autofocus and Zenith TV remote controls).
When air and distance are not concerns, much higher frequency ultrasound is used, as for medical diagnostics.