St_Union comes in two flavors, aggregate and simple.
In your query you are using the simple one that is creating the union of two single geometries.
What you are doing is cross joining your two tables, and make union of every combination of the geometries of your two tables, resulting in n*mn*m
multipolygons, where nn is the row count of your first table and mm the count of the second one.
This is called a cartesian product.
To accomplish what you want, you need to use the aggregate version, that will behave like the sql-standard sum function. Something like :
SELECT st_union(geom) FROM (SELECT geom FROM table1 UNION SELECT geom FROM table2) as foo