It's actually quite simple. In a fair game you expect to leave with as much money as you started with. initial money = expected final money = p * all money
Also, it's not quite clear to me why in this case initial money = expected final money. For the related game where you go double-or-nothing on each bet, it's evident this holds since the expected value of your next turn is the same as your current (I believe it's called martingale property), but that doesn't hold for the game in the article where you win +1 or -1 unit each bet, since if you e.g. have 4 units and the win state is 5 units, you're more likely to win than lose.
Edit: nevermind, I think it is a martingale since if you're at 4 units the expected value of the next state is 0.5*5 + 0.5*3 = 4. I guess my confusion stemmed from the fact that even though the long-term expected value is unchanged, you can still have good odds of winning (which is balanced by a small chance of a catastrophic loss), e.g. 4 = 0 * 1/5 + 5 * 4/5.