Basically there’s too much pressure at the tap, which causes the co2 in the liquid to be released, hence the foam, there kinda useless imo.
You can fix it by connecting the keg to the tap with 3/16 beer line, this will reduce the pressure at the tap.
Something like this...