History of use

Stereolithography machines are basically 3D printers that can build any volume shape as a series of slices. Ultimately these machines require a series of closed 2D contours that are filled in with solidified material as the layers are fused together.

The natural file format for such a machine would be a series of closed polygons corresponding to different Z-values. However, since it's possible to vary the layer thicknesses for a faster though less precise build, it seemed easier to define the model to be built as a closed polyhedron that could be sliced at the necessary horizontal levels.

The STL file format appears capable of defining a polyhedron with any polygonal facet, but in practice it's only ever used for triangles, which means that much of the syntax of the file is superfluous. It is also the case that the value of the normal shouldn't be necessary, since that is a direct calculation from the coordinates of the triangle with the orientation being controlled by the right hand rule.

STL files are supposed to be closed and connected like a combinatorial surface, where every triangular edge is part of exactly two triangles, and not self-intersecting. Since the syntax does not enforce this property, it can be ignored for applications where the closedness doesn't matter.

The closedness only matters insofar as the software which slices the triangles requires it to ensure that the resulting 2D polygons are closed. Sometimes such software can be written to clean up small discrepancies by moving endpoints of edges that are close together so that they coincide. The results are not predictable, but it is often sufficient to get the job done.

Obviously, there is much scope for "improvement" of this file format, which in its present form is nothing more than a listing of groups of 9 (or 12 if you care about the normals) floating point numbers embedded in some unnecessary syntax. Since each vertex is on average going to be used in six different triangles, considerable savings in memory could be obtained by listing all the points in a table at the beginning of the file, and concluding with a list of triangle definitions composed of triplets of integers that referenced this table.

However, for the purpose of generating a single contour slice using a very lightweight piece of software on a computer with little memory, this format is perfect since it can be processed in one pass regardless of file size.

Use in other fields.

Many Computer-aided design systems are able to output the STL file format among their other formats because it's quick and easy to implement, if you ignore the connection criteria of the triangles. Many Computer-aided manufacturing systems require triangulated models as the basis of their calculation.

Since an STL file output, of a sorts, is almost always available from the CAD system, it's often used as a quick method for importing the necessary triangulated geometry into the CAM system.

It can also be used for interchanging data between CAD/CAM systems and computational environments such as Mathematica.

Once it works, there is very little motivation to change, even though it is far from the most memory and computationally efficient method for transferring this data. Many integrated CAD and CAM systems transfer their geometric data using this accidental file format, because it's impossible to go wrong.

There are many other file formats capable of encoding triangles available, such as VRML, DXF, but they have the disadvantage that it's possible to put things other than triangles into it, and thus produce something ambiguous or unusable.