Steps for workaround:
1. Open caja or any file manager.
2. Unmount all the partitions on the drive by clicking on the eject button.
3. Open Gnome Disk Utility or run "gnome-disks" command.
4. Select the HDD.
5. Click the "Drive Options" button located on the upper right.
6. Click "power off".
I found a workaround.
Steps for workaround:
1. Open caja or any file manager.
2. Unmount all the partitions on the drive by clicking on the eject button.
3. Open Gnome Disk Utility or run "gnome-disks" command.
4. Select the HDD.
5. Click the "Drive Options" button located on the upper right.
6. Click "power off".
The drive will not spin up again.