Question: I know that both Fourier and wavelet can be used for compression of signals. 

The Fourier series guarantees that it gets the closest approximation of the original signal in the least squared sense. It also decomposes the signal into orthogonal components. So, I wonder why it isn't obvious to always use the `Fourier` series as a compression algorithm?

The Wavelet transform allows us to observe frequencies at different times, because it is localized in time (at least relative to the fourier transform). So it is only useful when we care about the interpretability of the components, it seems to me.

Why is the `wavelet compression` used in practice much more than compression using a `fourier series`?

Answer: 
In short: **wavelets and relatives are pretty good at compacting a sufficiently large class of regular-enough and useful signals and images**. What follows are signal properties (and corresponding wavelet features) that make wavelets good (not best) candidates for lossy compression:

* **piecewise-smooth** (*vanishing moments*, or cancellation of low-order polynomials)
* **edges or jumps** (*gradient*-like or Laplacian *behavior* of wavelets)
* **localized oscillations** (zero-average and *wiggling* wavelet *shape*)
* **noise or spurious events** (*orthogonality* and sparsity enhancement)

As said by @hops, the efficiency of wavelets for compression depends of the good matching of a signal class and the chosen wavelets.

Let us restrict here to non-redundant discrete transformations: discrete Fourier and discrete wavelets. Both are orthogonal, or close enough (bio-orthogonal wavelets) to skip the distinction. 

So both, when transform coefficients are discarded, are least-squares approximations. But least-squares are not the best metric for compression: if you double the amplitude of a sample, the energy is multiplied by $4$, but it only adds one bit to the stored data, in a $\log\_2$ reasoning.

In a way, a transform will help compression if it reduces the logarithmic cost or bit-budget of a discrete signal; hence, if the coefficients have a power law $1/c^{\beta}$ that decreases fast enough (the highest the $\beta$, the better).

This feature is often called the **compressibility of signals**. It can be assessed empirically, but also theoretically based on complicated functional analysis (Besov, Sobolev spaces). 

However, consider the useful class of $C^\alpha$ piecewise regular signals, $\alpha \ge 1$. They are locally smooth, with jumps (edges). Taking the largest $M$ coefficients for compression (or **nonlinear** **approximation**), the mean squared error for the Fourier basis will asymptotically decrease in $1/M$ for Fourier (because of Gibbs ringing). While wavelet approximations can decrease as $1/M^{-2\alpha}$. **The smoother the signal, the better the wavelet compressibility**. In other words, Fourier cannot use the regularity of the signal.

In practice, this is not so simple. The complex aspect of Fourier is somewhat difficult to handle. Quantization should be taken into account. The storage of the highest coefficients location costs too. Perceptual distortion should play a role, at least for lossy compression. 

So at low compression rates, local Fourier decompositions like the JPEG DCT can perform as well as wavelets, since asymptotic proofs do not apply. Indeed, local cosine bases, lapped orthogonal transforms that bridge the gap between Fourier and standard wavelets perform well too, and they are used in the MP3 standard (MDCT). For images, the 2D aspect renders separable wavelets less efficient than in 1D.

For strict lossless compression through, (wavelet) transforms are not the state-of-the-art yet.
It would be best if you quantified what you mean by wavelet compression being used "much more in practice" (by citing examples, etc). This would allow more specificity to the domain of interest, but I will try to give a reasonable (albeit general and not too technical) explanation. 

A wavelet transform and the Fourier Transform correspond to different choices of basis functions. Any basis can be used to get a perfect description of the function. If we decide to limit ourselves to $N$ coefficients where $N$ is less than the total number of basis vectors, we may do so using the least squares criterion as you suggested (or others). Note that for a good compression algorithm, the signal must be well approximated by only these $N$ coefficients where $N$ should be made small.

The basis functions of the Fourier Transform are complex exponentials with infinite support (from $-\infty$ to $+\infty$). If the signal being compressed is easily expressed as a summation of such sinusoids (as is the case for periodic signals), the Fourier transform coefficients will have a small number of components with a large magnitude. If we store only these high magnitude components, we will be able to reproduce the signal very accurately. If not, then we won't. Now, consider a piece of music. Does it contain one note that simply plays (and doesn't fluctuate in amplitude) for the entire song? Obviously not. When a new note is hit, we have to sum many sinusoids to express the idea of the note "starting" to play. 

The basis functions of a wavelet transform are dilated (and scaled) versions of the mother wavelet. The wavelet is usually chosen to have some compromise between its frequency resolution (or scaling resolution) and its time localization as you noted in your question. Now, a piece of music that is decomposed into (projected onto) these basis functions will only have components with a large magnitude at a small number of times and frequencies (dilations). This means that when a note starts to play, the wavelets corresponding to those frequencies will be activated (resulting in a large magnitude for those components). When the note stops, those coefficients will be lower (or zero). This means that the large magnitude coefficients that we retain in the compressed version are only at specific times and frequencies. 

Thus, a wavelet transform will be optimal for these situations. Then, one must choose a mother wavelet. This choice can also affect the compression ratio. If the wavelet approximates the signal well in both time and frequency resolution, then one would expect to have fewer large magnitude coefficients, resulting in better compression. 

A very useful way of looking at both transforms is how they divide up the time-frequency plane into "tiles." If these tiles correspond to the natural energy distribution of the signal in time and frequency, then one can expect a good compression ratio. If not, then not. Wavelets offer one more flexibility in tuning this tiling to a particular signal.

I hope that helps.

Note: I've avoided using the article "the" for the Wavelet Transform simply because one must always choose a mother wavelet to define the Wavelet Transform fully, and this choice impacts the effectiveness of the transform. This is one reason it is so useful though. Through the choice of this mother wavelet, we can find a good match for most signals occurring in practice.