The red ball is scored because it is at least slightly over the top of the goal, the blue ball is not because it is not even partially over the top of the goal. Basically, if a ball or barell are going to be stuck on the side, they need to be at least a little bit over the top of the goal.