What is the use of TPM-based Bitlocker if the drive gets decrypted automatically?

As with any security measure, this reduces the risk, it doesn't eliminate it.

With no TPM, an attacker with physical access can just grab the disk, walk away and read the data at their leisure. If the disk is encrypted with a key in a TPM, the attacker needs to walk away with the whole computer (or at least pull out the RAM and store it safely, to try a RAM remanence attack which isn't fully reliable).

This makes no difference if the attacker has uncontrolled physical access, but it makes a difference if the attacker has limited access, e.g. they're walking around in an office environment or in a coffeeshop and are observed. In such circumstances, it can be very easy to grab a removable drive, it takes less than a minute with a screwdriver to extract a hard disk, whereas extracting RAM tends to require a bit more time and walking away with the whole PC is less discreet.

If the attacker has full physical access, you've lost anyway, though a tamper-resistant TPM plus a PIN to unlock the key can make things hard for the attacker if the machine is powered down before they reach it. Basically, whoever has physical access to the computer owns the computer — but that's only true for unfettered physical access, not in more restricted scenarios. In some scenarios, partial protection is useful.

Use of a TPM-based key should be combined with secure boot, refusing to unlock the drive if not booting the pristine operating system from that drive, so that someone walking past can't just reboot onto their USB stick. It should also be combined with memory wiping at boot time (at least if the last power cycle was not ended cleanly) to prevent cold boot attacks.