Why does yoghurt need to feed on milk products? Why not plain sugar?
Lactobacillus is the genus of the bacteria responsible for making yogurt.

These bacteria consume sugars and excrete lactic acid. The acid denatures the proteins in the milk, causing them to coagulate into a delicious gel.

Lactobacilli can consume sugars other than just lactose.

https://en.m.wikipedia.org/wiki/Lactobacillus

The reason they eat lactose when making yogurt is because that's what they have. There is more than enough lactose in milk to make yogurt. There's no reason to add other sugars.

Lactobacilli are also responsible for the fermentation of pickles. In that case, even though they still produce lactic acid, they are consuming the sugars available in the vegetables, not lactose.