In my personal experience with sperm whales' recordings (echolocation and coda clicks), the MP3 compression didn't affect the sound for ID purposes. But this may depend on the sound you are recordings because the compression affects the "resolution" of the sound itself. If you link compression with low-quality recordings, then there could be more problems. I found it harder to analyse recordings at the level of the pulses of the clicks (so with a "zoom" in the time resolution). I can't state it was only because of the compression because also other settings were not as good as they were needed. This is in comparison with other recordings, where final settings were adopted.
In any case, it depends. It depends on the purpose you are recording and on the target species, as for other species you may need detailed features on the spectrogram for ID. But it also depends if you think of using the recordings for future studies: they may always be useful for other studies/other researchers that you don't know now.
Compression usually attenuates the original signal when it goes above a determined threshold (dB). They work with the human perception, which of course is limited. Thus they work well if you use them for listening purposes. But, this compression may affect the peaks of a signal, losing the info or distorting the signal.
But it depends on the way you compress the file. If you are recording with MP3, you're not gonna have back all the info lost, as it's a lossy compression technique.
Although, there are lossless compressions, from which you can go back to the original audio. For example, FLAC compression, which stands for "Free Lossless Audio Codec" and it's open-source. It's fast and works similarly to zip compression (https://xiph.org/flac/). There are some answers about it within this question (Does anyone regularly use FLAC compression for their acoustic data?).
Felis et al. (2019) explored different techniques/algorithms that can be applied to compress underwater acoustic files, that works differently than the "easy" MP3 compression. Of course, different techniques work better for different purposes.
In this paper by Kim et al. (2022), the authors explored a new method to compress long-term data collected with underwater acoustic sensors. They based the method on a lossless compression within the bandwidth of interest.
In conclusion, I would suggest not using MP3 compression. This kind of compression is ideal for listening purposes, as for just music. It is well adapted to our hearing capacity, which is limited compared to the diversity of frequencies you may find underwater. To store big datasets of recordings, you may find useful the FLAC compression. Or, you may think of using an algorithm that best fits your study objective, thus modifying/compressing recordings only to a limited bandwidth or use techniques to reduce redundant info.
Have a look also at this question How, if at all, are you compressing your recordings?.
Felis, I., Martínez, R., Ruiz, P., & Er-rachdi, H. (2019). Compression techniques of underwater acoustic signals for real-time underwater noise monitoring. Multidisciplinary Digital Publishing Institute Proceedings, 42(1), 80. http://dx.doi.org/10.3390/ecsa-6-06581
Kim, Y. G., Kim, D. G., Kim, K., Choi, C. H., Park, N. I., & Kim, H. K. (2022). An Efficient Compression Method of Underwater Acoustic Sensor Signals for Underwater Surveillance. Sensors, 22(9), 3415. https://doi.org/10.3390/s22093415