I don't believe it was foolish at all. It was, at the end of the day, remembering that D&D is a game and accomodating a new (if temporary) player to the game. That's not being foolish. It's making a choice to place the group's fun above strict in-game realism.
I ran into a similar situation in a past game. Eventually, it occurred to some of the players (including myself) that one or more of the PCs might be evil. So I asked the DM if he did, in fact, allow evil characters in his game. My reasoning was that I'd been playing my character as extra trusting, in spite of a very suspicious campaign scenario, and what could easily be very suspicious PCs. In order to allow for a fun group game, I
chose to ignore inconsistencies in the game, so we could avoid hours of paranoia and get to the
adventuring.
The DM wouldn't tell me whether or not he allowed evil PCs. He thought that'd be "unfair" to the evil PC (if there was one). The hell?! It was unfair to
me to not allow me to take the basic precautions I'd take in such a game, allowing a (potentially) evil PC to take advantage of my artificially trusting PC.
This is the same situation. The OP's party has chosen to be artificially trusting, in order to include a guest player in a game that, if they didn't make that choice, would be mired in paranoia and never get to the adventuring.
The DM had two choices himself.
1: He gives the players a short warning. "Remember that this is a stranger guys. Don't treat him any differently because you know he's a guest player." Now, this might make the players suspicious and spoil some of the surprise of the guest being a doppleganger, but the important thing is that the players are given all the information they need to correctly deal with the doppleganger.
2: He doesn't tell the players anything, and allows the guest player to use their attempt to be sociable to screw their PCs. This preserves the surprise of the guest PC being a doppleganger, at the price of, again, screwing the regular players.
Personally, I'd choose #1, and be furious at #2 (as my little side story might indicate

), but since it seems everyone in the group is still having fun, I suppose all's well that ends well.