According to the Multiverse Of Madness, Doctor Strange remembers Peter Parker in a specific way following the conclusion of Spider-Man: No Way Home. To save the multiverse from the Dark Hold-wielding Scarlet Witch in Sam Raimi’s horror-influenced Multiverse of Madness, Doctor Stephen Strange must intervene. This time around, Wanda is going after Xochitl Gomez’s America Chavez (who has the ability to jump between universes). Doctor Strange’s memory-wiping spell in No Way Home eliminated all traces of Peter Parker’s existence from the world, preventing the opening of numerous universes in the MCU.
We learn about a previous Multiverse incident involving Spider-Man in No Way Home when Strange and Wong first meet America in a café. Aside from shedding light on how Strange’s spell worked and how he was affected by it, this also provides some context. For the most part, the world and Doctor Strange have forgotten about Tom Holland’s Peter Parker.
Using the reference to Spider-Man and No Way Home as a Multiverse movie, it can be deduced that Strange remembers Spidey and the overall events of No Way Home they experienced together. What has changed is that he now knows that it is Peter who is wearing the masked identity. The success of Spider-Man: Far From Home, which revealed Spider-Man’s true identity to the public, was a precondition for the release of No Way Home. As a result, Peter and Strange’s efforts to undo that with his spell, and all of the events that followed, must change Strange’s memory of No Way Home’s sequence of events. This means that, despite the apparent contradiction, Doctor Strange 2 avoids a potential Spider-Man plot hole.
It was in No Way Home that Peter caved in the middle of a spell to restore his secret identity to Strange, which resulted in Spider-Man villains from other universes being drawn into the MCU, along with their own Spider-Men (with original Spideys Tobey Maguire and Andrew Garfield returning). In No Way Home, Strange’s memory of why everything occurred has been greatly altered due to the specific nature of the events. However, he has no recollection of Peter’s identity being made public or any attempt on either of their parts to magically overturn the consequences of the Multiverse-breach in No Way Home.
He may have a different memory of the hauled villains and other Spider-Men as a result. The Multiverse of Madness confirms that his memory is correct. But the details will have been altered to a different spell, resulting in an entirely different outcome.
When No Way Home came to an end, Peter didn’t restore the memory of MJ and restart his civilian life while continuing to protect people as Spider-Man. Doctor Strange’s mention of a Spider-Man Multiverse event in Multiverse of Madness suggests that he and the Wall-Crawler may cross paths again in Peter Parker’s next Marvel Cinematic Universe adventure. Strange and Peter Parker both remember Spider-Man: No Way Home in very different ways, so it’s clear that Strange will only recognize him as the Friendly Neighborhood Spider-Man when they meet.