Typically when you one thinks of legless reptiles, snakes come to mind. Their long slithering bodies and forked tongues are unmistakable, and for many people, snakes conjure up their worst fears. If given the choice of holding a lizard or a snake, many people would not hesitate to choose the former.
Despite the superficial dissimilarities between snakes and other reptiles, snakes are genetically nested within lizards (group H in the figure below) suggesting that they are actually legless lizards. Specifically, scientists  think they descended from an ancestor shared with iguanas and monitor lizards (group E).
This phylogeny from Pyron et al.  was estimated with 12896 letters of DNA. Click to see more detail.
Not only are snakes more genetically related to things like iguanas than other lizards are, but various species of legless reptiles have DNA that is more like other lizards than it is to snakes.
One example is the dibamids: legless, burrowing lizards, with eyes hidden beneath scales. These species are found at the very base of the lizard portion of the tree (top of phylogeny), suggesting that they are a very early lizard offshoot.
Then there are the pygopodids, which are genetically nested within geckos (section A of figure). Just like geckos, these species have the ability to make high-pitched squeaks. Snakes, by contrast, cannot vocalize. Additionally, pygopodids do not possess the forked tongue found in snakes.
Section B of the phylogeny represents the scincoids. Unlike Gekkota, there are various examples of legless reptiles scattered throughout. For example, the seps (Tetradactylus) are found within the plated lizards (Gerrhosauridae). Seps have variable levels of leg reduction, with some completely legless and some with very tiny legs.
The seps (left) with a plated lizard (Gerrhosaurus; right) for comparison.
Above, Chamaesaura (left), which has highly reduced legs, is found within the girdled lizards (Cordylidae). To the right, an armadillo girdled lizard (Ouroborus cataphractus).
There are many examples of legless reptiles nested within the skink family (Scincidae), including Typhlosaurus (right above), and Neoseps, which has very small leg remnants (right below). To the left is a shingleback skink (Tiliqua rugosa), more typical of the skink family in having legs.
Section D of the phylogeny represents the lacertoids, which contains two prominent examples of legless reptiles. The first example is Bachia, which includes species without legs and species with diminutive legs.
The second is the amphisbaenians, also known as worm lizards. Some species are completely legless, such as the Iberian worm lizard (Blanus cinereus), while others have two front legs but no hind limbs, such as the aptly names Bipes.
Blanus cinereus (left) and Bipes (right)
Worm lizards have right lungs that are reduced in size whereas snakes have much smaller left lungs. Additionally, they are more genetically similar to the wall lizards (Lacertidae), such as the green lizard (Lacerta viridis) below, than they are to snakes.
The final portion of the phylogeny with legless lizards is Anguimorpha (F in the figure). Some legless anguimorphs have eye lids and ear openings, both of which are absent in snakes. Examples include the anniellids (e.g., Anniella campi) and some anguids (e.g. Ophisaurus).
Both of these groups are more genetically similar to alligator lizards (below; Anguidae) than they are to snakes.
In short, there are many examples of legless or nearly legless reptiles, including snakes, genetically nested within lizards. Evolutionary biologists believe that this is evidence that leglessness in lizards has evolved repeatedly, often in the context of living underground or in other habitats in which legs may hamper the locomotion of the animal.
Questions for Creationists
If God created DNA, and DNA encodes the anatomy of an animal, why is it that He created so many species of legless reptiles that are genetically similar to legged lizards? Shouldn’t all legless reptiles, including snakes, be most genetically similar to each other, to the exclusion of legged lizards? Why would God create lizards with diminutive, nearly useless limbs, like those of Seps, Chamaesaura, and Bipes? Would it not have made more sense to create legless and legged species, as opposed to species seemingly in between?