Have you tried both of Pages Edit menu options: 1) Paste, and 2) Paste and Match Style? If neither choice rid you of the stygian background, you might try selecting the effected text, and from the Advanced Options (⚙︎v) menu, set the Text Background color to transparent.
If all three of these approaches do not rid you of the background color, then you may have to first paste the VSCode content into TextEdit, and then reselect the text there, and copy/paste into Pages using one of the two Edit menu choices.
Unlike LibreOffice Writer, MS Word, or even TextEdit, Pages is not designed to be a paste destination for HTML, styled or otherwise. I happen to use Textastic from the Mac App Store, and it pastes the HTML text colors from the TextMate theme I happen to be using, but not the dark background color.