Whats the point of "that" rule?

Keeper makes a blunder and gets a free pass cause of it? Can't see how they gained an advantage from it. 

Or how the offside rule actually makes sense in that situation. 

#WorldCup2022 #FIFAWorldCup