No, CoCs became a trend way before covid made remote work possible for the masses. They initially were demanded by project members after high-profile scandals of some kind, usually racist or otherwise discriminatory bullshit, sexual assault on conferences or bullying (Linus Torvalds for example used to be infamous for his language), and then other projects (or their members) wanted ones as well as a preventive measure for the future.
For what it's worth, I dislike CoCs because many of them are written with the assumption that people will behave like utter trash without being explicitly told not to and I grew up with the old "Don't be an asshole" rule [1]... but given what happened in the past where people were clearly incapable of not being assholes and communities having splintered over it, they seem to be inevitable.
[1] https://en.wikipedia.org/wiki/Wikipedia:The_No_Asshole_Rule
They are both.
A CoC, like other weapons, is more or less value-free. The CoC itself doesn't care what you point it at. It's a question of who is wielding it, and who they're wielding it against.
[*] yes, it can be more complicated than this. you get my meaning.
Language projects with a community Code of Conduct:
Python, Rust, Golang, Ruby, Perl5, Erlang, Elixir, Zig, ISO C++ (WG21 https://isocpp.org/std/standing-documents/sd-4-wg21-practice...), ISO C (WG14) https://lists.isocpp.org/liaison/2021/04/0444.php), ECMA/JavaScript (https://tc39.es/code-of-conduct/)
Language projects without:
Java (Oracle's, anyway), Nim
That was certainly not my experience; I left because all discussions were monopolised by a few seemingly unemployed accounts to shame any and everyone into agreeing with whatever the vocal minority at the time was pushing.
When I stopped reading it, the only people left were those who were constantly using shaming language on anyone who didn't agree about things like a code of conduct, or words are violence too, etc.