Yes, it is illegal to consume alcohol in public, even if contained within a paper bag.
Did they have a right to search? Probable cause is loosely defined as sufficient evidence to make it reasonable to assume that evidence exists in the place they want to search for it. In determining probable cause, the police can draw on their training and experience. Most people that drink from paper bags aren't covering root beer, so I'm sure they'd say they thought you had real beer inside.
Having said that, their conduct beyond that (dropping your property on the ground and presumably damaging it or spilling it) appears improper.
So now what are you going to do? I doubt any attorney will take on a civil rights violation lawsuit over a bottle of root beer, so a lawsuit appears out of the question unless you want to handle it yourself.
Or - you could file a complaint with the police department for the officer's conduct.