There are several reasons for compactifying of a space in general. But there are two good reasons in my mind:
To do intersection theory on a space it is good to work with a compact space. For instance, the projective line is a natural compactification of the affine line. you loosloose the information about a point on the affine line via homology: you can move that point to infinity on the projective line, the result on the affine line is the disappearance of the point. So, there is not a well-defined notion of degree for divisors on the affine line. This generalizes easily to higher dimensional cases. We can't prove the Bezout theorem on non-compact spaces since it is not true.
The second reason is more about moduli spaces:
Points on a moduli space correspond to some objects in a category $C$ which are being parametrized by the moduli space. When there is a notion of continuos change of objects of $C$ we get a topology on the moduli space. The moduli space is not compact when it doesn't contain some limits of families of the objects of $C$. So, a compactification should be considered as adding a class of natural limits of the objects of $C$. We get different compactification if we give different interpretation of points on the moduli space. For example $M_{0,5}$, the moduli space of smooth pointed curves of genus zero with 5 points is an open subset of $\mathbb{P}^1 \times \mathbb{P}^1$. Its Deligne-Mumford compactification $\overline{M}_{0,5}$, which is $\mathbb{P}^1 \times \mathbb{P}^1$ blown-up at three points is not just $\mathbb{P}^1 \times \mathbb{P}^1$.
The second space doesn't give a flat family of stable curves of genus zero with 5 disjoint sections in the smooth locus of the fibers as an extension of the universal family of curves over $M_{0,5}$.