1670s, templet "horizontal piece under a girder or beam," probably from French templet "weaver's stretcher," diminutive of temple, which meant the same thing, from Latin templum "plank, rafter," also "building for worship" (see temple (n.1)).
The meaning "pattern or gauge for shaping a piece of work" is first recorded 1819 in this form, earlier temple (1680s); the form was altered 1844, probably influenced by plate, but the pronunciation did not begin to shift until much more recently.
template tem·plate or tem·plet (těm'plĭt)
n.
A pattern or gauge, such as a thin metal plate with a cut pattern, used as a guide in making something accurately, as in woodworking.
A molecule, such as DNA, that serves as a pattern for the synthesis of a macromolecule, as of RNA.