Well I don’t know if “knowing that friends bet on it” could be against a code of conduct. I mean, if a friend bet on him scoring the first goal, would he have been obliged to deliberately miss had the opportunity arisen, so they did not get a payout? (Or perhaps more relevant for a goalie, bet on him saving a penalty.) But it’s potentially a bit of a grey area. If he told them in advance he would eat a pie, or someone paid him to do so, then he certainly should be in trouble.
Incidentally I was at lords when that bowler bowled the ridiculous no-ball cos he’d been paid by a betting syndicate. Ran half-way down the pitch before letting go, it was completely bizarre. Thought he’d just had a completely mental failure but wasn’t surprised to hear the real reason!