I think this is one of those 'helpful' things because Xcode doesn't want you to miss out the trailing quote for a String, etc.
I can't find any option to turn it off in either Xcode's settings, or System Settings > Keyboard. And there's nothing in right-click substitutions (they all seem disabled).
I recommend you raise a suggestion in the normal way and ask that they include some way of not doing this in files with certain extensions.
If you look in Xcode's settings > General tab, this is the sort of thing I mean, and it would include: md, txt, xml...:

Your bug/suggestion won't really get progressed if it's only posted in these Developer Forums.
Raise it at https://feedbackassistant.apple.com/ You can then post the FB number here if you want.