Should I change a graduate class grade to pass/fail? Will it harm my PHD applications?
Grades matter when applying to graduate programs...until they do not. For the most part, a B is never a disqualifier for getting into a PhD program. (Getting a C or D...or F might be more worrisome). As long as you have a 3.8 or higher in your masters program, I usually would not even dig too far into the specifics of your grades if I was reviewing your submission.
When I evaluate graduate student applications, I place much more weight on letters of recommendation and personal statements. Especially where the measure theory class is not a core topic in your field, getting a B should not matter too much. Get strong LORs and write a good personal statement and you should be fine. You even could mention the challenges of COVID in your statement. (Although, I honestly would not even bring up the B. Least said, soonest mended).
I would not recommend changing the grade to a Pass; this looks like you actually are trying to hide something. Move on from the B and focus on building a good resume of experience and connections.