This question has me a bit stumped, I even when out a cut a few Chives to check this out!
They will drip some moisture if squeezed. I could not find any research that would find a reason for it to be foamy.
If you feel the plant is limp or smells bad in any way I would dispose of.
Spittle Bugs can cause a foaming residue on plants, but they generally do not harm a plant and can be washed away.
Here is a few links with more information.
https://www.gardeningknowhow.com/edible/herbs/chives/growing-chives.htm
https://www.gardeningknowhow.com/edible/herbs/hgen/herb-growing-problems.htm