How does an optical spatial filter work? As I understand, a spatial filter is a lens followed by a small hole and is used to clean up non-Gaussian modes in a beam of light. Wouldn't the light diffract through the small hole producing an Airy pattern, which would just add non-Gaussian modes back into the beam and defeat the purpose of the spatial filter?
 A: The principle behind the use of a pinhole in the way that you describe is simply to create a subresolvable source of light, thus destroying all wavefront information. You are correct that the exact diffraction pattern from a subresolvable point source is not Gaussian, but it is very nearly so and indeed Gaussian modes are the eigenfunctions of an approximation to the wave equation that holds for paraxial fields, i.e. fields of very small numerical aperture and with wave vectors all directed to within about 0.1 radians of the nominal beam propagation direction.
So in practice the beam will become more Gaussian after passage through a subresolvable pinhole, i.e. one of diameter that is smaller than approximately $\lambda/NA$, where $NA$ is the beam's numerical aperture.
A: Although I am not an expert on this, I would like to share some thoughts. 
I think a pinhole is often used to remove gross imperfections of the beam.  Since the pinhole necessarily truncates the beam,  what comes out can not be Gaussian any more, since the Gaussian function extends to infinity.  What comes out of the pinhole depends upon the variation of phase and amplitude of the wave inside the pinhole, and the computation of this is quite complicated.  If you are not afraid of a mouthful, I can recommend the book "Waves in focal regions" by J.J. Stamnes.  Here is explained theory and algorithms for accurate computation of diffraction patterns.  If the phase and amplitude are constant over the aperture of the pinhole, I believe you get something like the Airy pattern.  Another interesting fact is that the gaussian beam is not a solution of Maxwell's equations, it is only an approximation. I believe that the following papers discuss this topic although I have no longer access to them and may not remember correctly.
Geometrical representation of the fundamental mode of a Gaussian beam
in oblate spheroidal coordinates
B Tehan Landesman
JOSA A 6 (1) January 1989 pp 5-17
Gaussian amplitude functions that are exact solutions to the scalar
Helmholtz equation
B Tehan Landesman, H H Barrett
JOSA A 5 (10) October 1988 pp 1610-1619
The diameter of the pinhole is of course important, and if it is too large, aberrations of the input beam may be transmitted.  But this I feel is a question of degree, and the permitted error depends on the use of the beam afterwards.  If the pinhole is to be the source in a Twyman-Green interferometer, for instance, the question is if the size of these errrors is so small that they do not affect the accuracy of the interferometer. 
A: A spatial filter is not a lens followed by a pinhole. It is the pinhole itself. It is used to filter out high frequencies of the laser light. Typically, a spatial filter should pass only the central Airy disk. The Airy diameter can be calculated to be A = 2.44 lambda F/#, where lambda is the wavelength in microns and F/# is the focal length divided by the entrance pupil diameter (of the lens imaging the light onto the pinhole).The pinhole passes the light contained within the Airy diameter only. There is a dark ring where the edge of the pinhole resides so you don't get diffraction from the edge of the pinhole. The Airy pattern is formed by the microscope objective you are using to image the laser light onto the pinhole. It makes for a very clean beam.
