I had deleted my windows partitions completely. But even after that, there was the windows boot entry displayed in BIOS (UEFI). When I tried to boot into that boot entry, it showed the message that the windows installed was damaged. Then, I installed windows again. Each time on booting, there were two entries, one showing the error and another one which booted me into the windows I just installed. There was also another folder windows.old in the C drive. I removed that folder using the disk cleanup option. But each time I boot, the two options are still being displayed. What had happened and how can I remove the other boot option?
The entries in your UEFI BIOS are independent of the partitions on your drives.
If you want the errant entry removed, you would do so through the UEFI BIOS settings. Nothing you do on the drive will change that.
Windows will often fix this during setup, but in your case, it appears to have been orphaned and you'll need to remove it yourself.
You didn't specify exact make and model of your computer, so you'll have to refer to the owner's manual or do further research to determine what exact steps to take to remove the entry from the UEFI BIOS.
Here's a helpful sequence of instructions from the folks at Laptop Magazine: https://www.laptopmag.com/articles/fix-0xc0000034-error-windows-10. Explains how to rebuild the BCD for a Win10 PC.