"Over" in this context means that you will be talking or taking some similar action during the time when you are eating or drinking something, or (much more rarely) doing some other activity.
If you used "with" in this case it would change the meaning. Consider these sentences.
Bob and Willard fell in love over dinner
means that they fell in love while they were eating their dinner. If you say:
Bob and Willard fell in love with dinner
it means they really, really like their dinner. Using this construction, even where it is less ambiguous, to mean "while eating dinner" is not very idiomatic. You can have wine with dinner; you have a discussion over dinner or during dinner.
You can restate this in other ways, however.
Let's work out the details over a couple of beers
can be restated as:
Let's work out the details while we drink a couple of beers
but this sounds a bit awkward and stilted. My guess is that that's why the shorter "over" idiom came to be--it avoids the ambiguity of "with" but is simpler than constructions like "while we eat" or "to accompany" or suchlike.
As a mnemonic--and a plausible origin--think of two people sitting at a table drinking tea. The tea is in cups on the table; the discussion passes over it, above the table. The discussion is literally happening "over" the tea.