The reason they only keep XP bonuses after a match in the portal is actually quite simple: too many players are using the portal bots to farm weapon XP or complete assignment challenges.
After the last update, DICE reduced the weapon XP bonus from the portal bots to 20% of its original, but the XP farm in the portal hasn't decreased at all. Players have found that as long as they can still gain XP or complete challenges from the bots, playing against them in the portal is always easier than playing against other players.
I think DICE is well aware of why players would rather spend hours tediously killing tens of thousands of bots in the portal than completing upgrade/assignment challenges in multiplayer. (They also slightly reduced the experience bonus for weapon upgrades when adjusting portal bot experience.) They simply don't want to admit their design failures with weapon attachment unlocks, assignment challenges, and class missions, which are currently the worst part of BF6.
The developers' original plan was for all players to spend dozens of hours unlocking weapon attachments and dozens of hours completing assignment challenges. If the average player only has one or two hours a day to play, it would take them years to complete. And Battlefield 7 will be released at that time. Therefore, portal bots that shorten the player's game time cannot exist anymore, and any accidents that exceed their schedule must be killed in advance.