An expected value puzzle

Consider the following game setup:

Each round of the game starts with you putting in all of your money. If you currently have \$10, then you must put in all of it to play. Now a coin is flipped. If it lands heads, you get back 10 times what you put in (\$100). If not, then you lose it all. You can keep playing this game until you have no more money.

What does a perfectly rational expected value reasoner do?

Supposing that this reasoner’s sole goal is to maximize the quantity of money that they own, then the expected value for putting in the money is always greater than 0. If you put in \$X, then you stand a 50% chance of getting \$10X back and a 50% chance of losing \$X. Thus, your expected value is 5X – X/2 = 9X/2.

This means that the expected value reasoner that wants to maximize their winnings would keep putting in their money until, eventually, they lose it all.

What’s wrong with this line of reasoning (if anything)? Does it serve as a reductio ad absurdum of expected value reasoning?