You actually look to have most of the basic ideas on this, especially from your last sentence.
VAT is recoverable on all purchases you incur in the course of business, what happens is if you give it away or drink it then you haven't used it for a business purpose and hence shouldn't have recovered the VAT. If you have recovered the VAT then you've left HMRC funding your generosity (or alcoholism); as you say, no VAT on sale less VAT on purchase gives a VAT refund!
So to counter this, since VAT is a tax on the final consumer, when you become the final consumer (i.e. give it away, drink it yourself) you become liable to a VAT charge so that VAT is paid somewhere in the supply chain. This charge is normally equivelant to the VAT you recovered on those goods so that it all nets off so that you have paid VAT equal to that recovered on that particular case or bottle.
One ray of light is that you can make business gifts up to a value of £50 per recipient per year without needing to pay VAT. Another is that if you sell it to an unconnected party (i.e. not a spouse, civil partner, or relative of yourself ,or your spouse/civil partner) then you will only pay the VAT on the money you take in, so instead of giving it away you can practically give it away by charging 5p for the lot, or whatever. You can also do 'buy one get one frees' without problem as the price received will be seen under VAT law as for both bottles/cases, even if the charge is just the same as the one on the 'good' stock.
You can also just pour it away without problem as spoilage and wasteage are allowable 'uses' for VAT, but if you do this keep good records to support it (perhaps get a stocktaker or someone else to dispose of it for you, I must admit I really have no idea how best you'd find support to prove you'd poured it away), as there's nothing that peaks the VAT mans interest more than 500 bottles bought, 250 bottles sold, stock on hand nil!
Hope this helps