Essentially when you are adding the sum of multiples of 2 and sum of multiples of 3, you are adding numbers like 6, 12,… which are included in both the first sum as well as the second one. So, you need to subtract the sum of common elements once to eliminate this double counting.
You can also solve this using venn diagram.