The expression comes from the Middle Ages. At that time, wine was expensive and scarce. Innkeepers therefore often diluted their wine with water. To bring the taste back into line, they mixed in acetic clay, for example.
Of course, not every innkeeper diluted his wine with other ingredients. Honest innkeepers poured their customers pure wine. This is the origin of today's saying.
Someone pours pure wine when he tells the unvarnished truth. He is thus as honest as the innkeepers of old who poured out pure wine.