In general filters is needed to eliminate or reduce harmonic distortion that caused by power electronics devices as VSI. Some regulation as IEEE519 and others limits THD to lower than certain value. Look at the link blow.
Mohammad, firstly, a VSI generates a PWM voltage at its output, full of harmonics (usually higher order) and is never sinusoidal without additional filters. If you are referring to a VSI feeding a motor drive, then the L (series) filter is to limit the harmonic components of currents, since the value of reactance increases with harmonic frequency, thereby restricting their flow. If you are referring to a VSI connected to the grid, then the L filter is to limit the circulating current (which will appear as current harmonics) that would arise due to the instantaneous difference in waveform between the sinusoidal grid voltage and the PWM inverter voltage.