When you join the tables make sure you include all columns that need to be linked in your ON clause. Your WHERE clause should contain only the filter for the main table:
select m.address_id,m.hub_id,m.location,d.distance
from main m
left join distance d on m.address_id=d.address_id AND m.hub_id=d.hub_id AND m.location = d.location
where m.hub_id=20
And please, use the tags when you writing the questions