Ryan is a generally good guy but can be manipulative and passive-aggressive. Given The Reveal of Wilfred's truenature, it makes perfect sense that he's the embodiment of Ryan's id.
Fridge Horror
The series finale reveals that Wilfred was just a normal dog whose owner moved next door to an insane person who latched onto him and spent virtually every day dragging him through countless delusional episodes. As a result, he got hit by a car and subjected to so much second-hand smoke that he died from lung cancer. Poor dog!