So there's a lot of subjectivity in those calls. Given the distance and the defender's position, IMO that should not have been given.
Handling the ball
It is an offence if a player:
deliberately touches the ball with their hand/arm, including moving the hand/arm towards the ball
gains possession/control of the ball after it has touched their hand/arm and then:
scores in the opponents’ goal
creates a goal-scoring opportunity
scores in the opponents’ goal directly from their hand/arm, even if accidental, including by the goalkeeper
It is usually an offence if a player:
touches the ball with their hand/arm when:
the hand/arm has made their body unnaturally bigger
the hand/arm is above/beyond their shoulder level (unless the player deliberately plays the ball which then touches their hand/arm)
The above offences apply even if the ball touches a player’s hand/arm directly from the head or body (including the foot) of another player who is close.
Except for the above offences, it is not usually an offence if the ball touches a player’s hand/arm:
directly from the player’s own head or body (including the foot)
directly from the head or body (including the foot) of another player who is close
if the hand/arm is close to the body and does not make the body unnaturally bigger
when a player falls and the hand/arm is between the body and the ground to support the body, but not extended laterally or vertically away from the body
The goalkeeper has the same restrictions on handling the ball as any other player outside the penalty area. If the goalkeeper handles the ball inside their penalty area when not permitted to do so, an indirect free kick is awarded but there is no disciplinary sanction.