As sumwun said, the data for the fused Pokemon is stored elsewhere in the save data so that it can be retrieved later when the fusion is undone. Furthermore, the items used to create the fusions are coded as a pair, one that fuses and another that separates (you can see how using the item changes its description in the bag to the opposite function). This is also why you can only have one Kyurem fusion and one Necrozma fusion at a time; there's only one slot for each Pokemon and using the fusing item prevents you from performing a second fusion without undoing the first.
As for the problem being easy to fix, it depends on what you mean by "easy" and "fix". Allowing fused Pokemon to be freely traded or transferred while still retaining the ability to unfuse them later would require doubling the size of the Pokemon data structure to accommodate the fused Pokemon, but this is a waste of space given that only two Pokemon are capable of fusing. A more efficient albeit still limited solution might be to have one fused Pokemon slot for each Pokemon you can fuse (Reshiram, Zekrom, Solgaleo, and Lunala) and if a fused Kyurem or Necrozma is traded or deposited in Bank, the fused data corresponding to its form is transferred along with it. This would of course still prevent you from having more than one of a given form on one save file or in Bank at a time, but at least you could get both Kyurem and both Necrozma at once and could finally trade or Bank them.
Of course this is Game Freak, the same company that took over a decade to figure out how to code alternate forms with different base HP stats. I wouldn't get your hopes up for them addressing this issue any time soon. Though to be fair they did fix Furfrou, Shaymin, and Hoopa reverting to their base forms in the PC this gen, so who knows...