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*m` multipolygons, where **n** is the row count of your first table and **m** the count of the second one.
This is called a [cartesian product][1].

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

[1]:https://en.wikipedia.org/wiki/Cartesian_product