I'd sooner burn the money than buy a lottery ticket.

Literal

Lottery [object-を] buy [to-the-degree-くらいなら], that money [object-を] burn-[completive-てしまった] side [subject-が] still-better

~くらいなら...方がましだ is a set comparison: 'if it's going to be as bad as X, then Y is the lesser evil.' ましだ = 'still better/preferable.' ~てしまう on 燃やす adds emotional finality — 'just go ahead and burn it.' The hyperbole makes this vivid and memorable.