A foul ball is an intermediate result between a "strike" (a total miss) and a "fair ball" (one that goes into play). Logically, a foul ball should be scored in an intermediate fashion between a strike and a fair ball as well.
One way of doing this is to count "half" strikes for a foul ball. That would cause a certain amount of game confusion keeping track of these "half" strikes.
Another way of achieving a comparable, and equitable, result is to award the first two foul balls in an at bat as strikes to the pitcher, and the remaining ones as "free" shots to the batter. In practice, it would mean that about half the foul balls are counted as strikes, and about half (after the second one) are not.
In theory, it means the that "burden of proof" is on the hitter to put the ball in play on the first two fouls, but for the third strike, the "burden of proof" is on the pitcher to get a "full" (not a foul, or "half") strike.
It's not unfair for the pitcher to have foul balls recorded as strikes, while the batter is not put out. All contacted balls (plus called strikes) are strikes for the pitcher. That includes "fair balls" that become hits, or outs, as well as foul balls, whether or not they become "strikes" for the batter.