The lock switch on an SD card is a simple physical mechanism. The card reader feels for a gap where the lock switch should be, and if it feels a gap it write-protects, but if the tab is there it enables write.
(If the lock switch breaks off, you can put masking tape where it used to be, in order to be able to write to the card. It's basically the same principle as these if you are old enough to remember.)
As you've said, the switch is in the correct position, and the problem occurs when the card is in the computer, so we can probably rule out the camera being the problem - the problem is likely to be the card, or the reader in the computer.
To troubleshoot, try different cards in the card reader on the computer and see if it writes to them. If you have other card readers, try the same card in other card readers.
I think the problem is likely to be one of the following:
Tab on card is broken, and it's not quite sitting in the right position, or staying there when you insert it in a reader.
Lever in the card reader that feels the presence of the tab is broken.
Card or reader is a cheaper brand and the shape of the card, reader, write-protect tab or lever is not quite in the right position.