Why is 2-ethylpentane is not a valid IUPAC name, but 3-ethylpentane is?
Due to IUPAC conventions, the main alkane name is based on its longest chain. Here is an image showing different chain lengths for both alkanes. The numbers denote the longest alkane chain:



As you can see, 3-ethylpentane is symmetrical; no matter what chain you count along, the longest chain will always be 5 carbons long (pentane), and the ethyl group will always be on the third carbon (3-ethyl). Together, this is 3-ethylpentane.

However, if you look at '2-ethylpentane', there's a new longest chain which isn't 5 carbons long anymore. The image shows a new chain which is actually 6 carbons long (hexane), and there's now a methyl group on the third carbon (3-methyl). Together, this is 3-methylhexane. Because of this, '2-ethylpentane' isn't a real structure, since drawing it will leave you with 3-methylhexane as shown in the image.