Here's a solution for this:
# Create new df isolating the two variables of interest AND
# Remove duplicates from df_B based on 'ID'
df_B_distinct <- df_B %>%
select(ID, Distance) %>%
distinct(ID, .keep_all = TRUE)
# Perform the join
result <- df_A %>%
left_join(df_B_distinct, by = "ID")