He is a machine made by Gengai, originally meant to be Gintoki's perfect substitute while he was away.
Spoiler, click to view He actually brainwashes the entire town apart from Tama and Sadaharu, replacing their memories of Gintoki with those of himself. Even as to put himself into every Manga Volume and DVD of the series.