The functions of immune cells in lymph node metastasis (LNM) have attracted considerable attention. This study aimed to screen the key immune-related and LNM-related genes in PTC. In the discovery phase, the immune-related genes in LNM were screened by using bioinformatics methods. In the validation phases, the association of the genes with LNM was first confirmed in a cohort from The Cancer Genome Atlas and a cohort based on a tissue chip. Then, the relationship of the genes with immune cell infiltration was further explored. Consequently, CLDN10 was identified, and its high expression was correlated with the presence of LNM in PTC but predicted a favorable prognosis. High CLDN10 expression was positively correlated with the infiltration of several immune cells, such as B cells, CD8+T cells, and macrophages. High CLDN10 expression may improve the outcomes of patients with PTC by increasing immune cell infiltration, although it might be associated with LNM. In conclusion, although CLDN1 might be correlated with LNM, it may also increase the infiltration of immune cells, including CD8+T cells and macrophages, and improve the clinical outcomes of patients with PTC. The effects of tumor purity and immune cell infiltration need to be considered in prognosis evaluation.