Note that what you describe are only the binary products and coproducts. The respective universal properties generalize well to families of objects giving the categorical definition of arbitrary products and coproducts.
It is important to remark that categorical concepts usually arise as generalizations of constructions throughout mathematics. They capture some underlying "essence" of certain constructions. For example, the product of two objects is an object which "sees" the important things about two objects but nothing more and nothing less. The universal properties captures the characterization via factorization properties of morphisms.
Take the cartesian product $S_1\times S_2$ of two sets $S_1,S_2$. It is the set of ordered pairs $(s_1,s_2)\in S_1\times S_2$. As set-functions are uniquely determined by their input-output-relations, we can parametrize set-functions $f_1\colon T\to S_1$ and $f_2\colon T\to S_2$ capturing their "essence" as the set-function $f_1\times f_2\colon T\to S_1\times S_2$ which is simply given by $t\mapsto(f_1(t),f_2(t))$. This is possible as we can recover this information by projecting onto both sets $S_1$ and $S_2$ along the usual projection maps $\pi_1\colon S_1\times S_2\to S_1$ and $\pi_2\colon S_1\times S_2\to T$ just giving back the first or second coordinate, respectively. This is a rough unpacking of the fundamental (structuralistic) ideas underlying the cartesian product.
A similar argument can be made for products of groups or topological spaces. In both cases we just consider the underlying cartesian product of sets and note that it comes equipped with natural compatible structures. From a category-theoretic point of view these structures are chosen such that the cartesian product inherits the structure of its factors and such that the projection become morphisms in the correct categories. In the case of arbitrary products of topological spaces this characterizes the product topology as the "right topology" (see the comments).
Noting that the "essence" of the product of sets, groups and topological spaces share certain similarities making them the correct constructions. We then formulate an abstract template of what such an object really does. Thinking purely structurally this is best done via a universal property.
They also have the advantage of being applicable to any category, hence maybe relating previously unrelated construction and applying patterns from other categories. And in the end this is one of the main accomplishments of category theory.
As to the why of universal properties. There are a few reasons. I would like to point out two very important ones. First, universal properties can be formulated diagrammtically, hence in any category and, second, universally define objects are unique up to unique isomorphism. These two give a computational aspect to such objects which is quite powerful.
Finally, regarding the role of products and coproduct in general. As it turns out, a large class of universal constructions (called limits/colimits) can be constructed using products and coproducts. And this holds generally speaking, not only in one specific category. Note, however, that the precise theorem requires the existence of a different construction (equalizers/coequalizers), but the role of products and coproducts is equally important.
Limit and colimit constructions are ubiquitous throughout mathematics and understanding how they are realized in general is quite an important thing. Seeing that they come from such (relatively) simple things as products and coproducts even more so.