Do you ever notice the "No purchase necessary"disclaimer on every contest or sweepstakes in existence? There's always another way to enter aside from purchasing.
Just FYI -
You don't have to buy McDonalds food to get their Monopoly pieces. Send a self-address stamped envelope to an address they specify in the fine print, and you get them for free - because of this law.
If a company advertises "Send in your proof of purchase for a chance to win an iPad/a million dollars/ etc." Then they have to, by law, also give you a non-purchase form of entry, usually also a mailing address.
Otherwise, they're infringing on gambling/lottery laws. It IS possible in most states to do what Steve was imagining (the law is more complicated than this article implies,) but it'd involve strict regulation and would be considered a form of gambling.
But you also have to consider that this would be a US-wide contest, so more than just California law would apply. It'd have to meet the standards of every state possible. Hence the other fine print: "Void where prohibited."
Plus consider the other legal problems - what's to stop someone from buying a thousand Macs, checking them all for the ticket, and then returning them only to buy more?