I unexpectedly lost a pretty important match in the league today as well, which will end up costing me first place, so I can sympathize. Almost all elements of the game are ultimately random, although you can skew the odds in your favor through tactics, formation and simply having a better team. But it is perfectly possible for you to have more ball possession and more shots/shots on target, a better formation or whatever and still lose. Or for your team to make less than half the amount of fouls your opponent does, yet you're the one who gets three yellow cards and they get three free kicks.

Compare it to rolling a die a bunch of times and not getting a six, and then someone else picks up the same die and rolls six on their first and only try. It happens. Everyone gets a bad beat every once in a while.