Explanation of rule from random guy:
Quick explanation to help those confused as to why this rule exists or how it makes sense. There's the field of play, and the endzones. Each team owns an endzone, swapping each quarter. No team owns the field of play. When you fumble the ball no one is in possession at that point, and it is a live ball. If you fall on it and maintain possession it becomes your ball whether you were on offense or defense when it was fumbled. If you fumble out of bounds in the field of play no one owns the ball at that point, so by default it goes back to the team who possessed it last since the field of play is neutral.
If you fumble through my endzone the ball is no longer possessed by either team, but by default goes to the team that owns that endzone. It makes perfect sense. No one possesses the live ball and it needs to go somewhere, so it defaults to whomever owns that endzone.
Still seems like a terrible penalty to the offense. I think they should be penalized and moved to a predetermined yard line, but the loss of possession seems a bit much.