I am not sure to which extent this will be satisfactory answer for you, but basically short answer is that this might happen but bookmakers have some tools they might use to reduce their losses or at least to make scenario you describe less probable. Namely, after some initial bets are placed, the bookmaker then adjusts the odds.
I should add that situation is in reality more complicated than this, since bookmakers offer possibility of multiple bets. And also bookmaker typically offers many events, so they can in fact afford loss on one match if they win on many others.
But, for the sake of simplicity, let us ignore this and let us consider the situation when the bookmaker only offers this match. The way you described it, the odds on Team A are 2.00. (Since you mentioned payout to be twice the wager. I am using decimal odds.) The odds on Team B might be, for example, around 1.80. (If the odds on both teams were exactly 2.00, bookmaker would make no profit when the same amount is put on both teams. So the odds on Team B will be definitely lower than 2.00.)1
So at the moment bookmaker can lose some money if Team A wins. Bookmaker wants to make profit whatever the outcome is. So they want to people to bet also on Team B. What can they do to encourage them to do that? They simply increase odds on Team B and decrease odds on Team A.
To continue with your example, let us say that the bookmaker changes odds to 1.70 on Team A and 1.90 on Team B. If the two teams are roughly of the same strength, the bettors are going to be more reluctant to make bet on Team A for lower ods. And they will be more likely to place bet on Team B.
If this change of odds was enough to make bettors to place 130$ on Team B, situation is now marginally profitable for the bookmaker. (They have 125+130=255. Depending on the result, they have to pay out either 125x2=250 or 130x1.9=247.) At this moment the bookmaker can adjust line again.
In reality the changes are not going to be that abrupt. And I assume that the whole thing is much more complicated than this simplistic example. Still, as far as I can tell, something like this is actually used. You can have a look at answers to this question: How do bookmakers select their opening odds?. In my answer I included quotes from an interview with actual trader which gives at least a very brief insight into how they create and adjust the odds. And, of course, other answers might be interesting too.
You might also compare this with betting exchanges, which actually work in such way that they are guaranteed to earn some profit. (They do not accept a wager straight away, only after another customer matches it.)
1 In general if odds on two-way event are a and b, exactly when 1/a+1/b=1 it is possible to place bets in such way that bookmaker does not make any profit. (For example, if a=b=2 and bets on each outcome are the same, then the profit is zero. Or if a=1.5 and b=3, then by betting on the first outcome twice the amount as on the second outcome, neither bettor nor the bookmaker makes any profit.) So in general you will see bookmakers offering odds slightly lower than this. That is you will have 1/a+1/b>1. Since I mentioned also betting exchanges, the formula 1/a+1/b=1 expresses in that case when a bet is matched.