Whenever I flash the Raspbian OS into the SD card, the SD card automatically goes into write protect mode. I was trying to bring up the xvisor on the RPi3. For this, you need to build a custom boot, kernel and then write it to the RPi3 partition. Since the partition has become write protected, I'm not able to copy these into the necessary partitions. Even when I try to format it in Windows and Linux(VM), it says the disk is write protected. The OS runs fine on the Pi, though.
Is there a reason why the SD card goes into write protect mode? Do I need to take any care while flashing so that the card doesn't go into write protection mode?
I have already replaced it twice because I would like to use the card for other purpose. Please help me understand why does the OS send the card (or rather partitions) into write protect mode and make the card unusable?