Computers very rarely make mistakes … they just do as they are told.
Safari has a setting in Preferences → General → Open “safe” files after downloading.
Turn this off and the .tar.gz file won’t be decompressed.
HTH
Peter