Do you have a small sample? I think we should be able to change the union to custom sql and verify the union command is used and not the 'union all' command. This will remove duplicate rows.
Reference for assistance - SQL UNION Operator
You might also consider blending as an alternative to joining -- often times, you can avoid the duplication that joins cause by using a blend instead. I have no idea if that will help here, as I didn't take a look at your data/scenario very closely, but in general, it is a good idea to consider blending when joins cause duplicate rows. See also: https://www.tableau.com/learn/tutorials/on-demand/when-blend-and-when-join