The StreetPass file was retained in Luigi's Mansion 2 HD because the Nintendo Switch version has the same file structure as the Nintendo 3DS version, and the folder was still being used in the game2. It was likely kept intact to avoid breaking the game, as removing any files could have caused issues.
The Scarescraper folder in Luigi's Mansion 2 was mislabeled as StreetPass because it was likely initially planned to have StreetPass functionality4. However, since the feature was not used in the final game, the folder remained but served a different purpose, containing Scarescraper-exclusive ghosts. The folder was not removed to avoid potential issues with the game.
No, the original Luigi's Mansion 2: Dark Moon did not use StreetPass functionality on the Nintendo 3DS. The presence of the StreetPass folder in the game files might be due to it being originally planned or simply a leftover from the development process2. The folder was still being used for other purposes in the game, so it was not removed.