Surely it takes slightly more concentration to walk through a doorway than across a room. You need to avoid bumping into the walls, make sense of an (initially) reduced field of vision, and take-in new surroundings... The idea that people mentally discard information because they've moved into a different room seems far less likely.
Did the article or researchers say it was just because someone was in a different room? The title is "Walking through a doorway makes you forget" not "You forget because you're in a new room."