Washington Irving sets up the Diedrich Knickerbocker authorship because he wants us to work out the truth of "The Legend of Sleepy Hollow" for ourselves.
Knickerbocker is an unreliable narrator who admits that he learned about the story from an old man in Manhattan. Irving adopts this narrative approach because he knows, as any good writer of fiction does, that it's always best to let the reader use their imagination and try and work out the truth for themselves. By using Knickerbocker as a narrator, and an unreliable narrator at that, Irving achieves his aim by establishing a critical distance between the narrative voice and the text.
Prior to writing "The Legend of Sleepy Hollow," Irving used the pseudonym of Diedrich Knickerbocker to sell his first major work, A History of New York, from the Beginning of the World to the End of the Dutch Dynasty. He claimed that the work had been compiled from the abandoned manuscripts of Knickerbocker, an old Dutch historian who'd suddenly vanished.
Irving's elaborate hoax worked like a charm, and his book sold like hotcakes. Having already used the name of Knickerbocker successfully once in his literary career, one might reasonably surmise that in "The Legend of Sleepy Hollow," Irving wanted to repeat the trick.