The episode is "A Night of Fright Is No Delight" – Season 1, Episode 10 of Scooby-Doo, Where Are You! (original 1969–1970 series), aired November 21, 1970.
The gang inherits a fortune from Colonel Beauregard Sanders—if they spend a night in his haunted mansion. The "ghosts" turn out to be three former U.S. presidents (George Washington, Abraham Lincoln, and Theodore Roosevelt)… or rather, criminals in presidential masks using the legend to scare off heirs.
Note: No actual presidential ghosts appear—it's a Scooby-Doo hoax, as always. The presidential angle is just the villain's thematic choice.