Lymph nodes filter impurities and infection from the bloodstream. Group of lymph nodes are located at either side of the groin (as well as other places). When these glands become infected, they are swollen and painful. The reasons could be any number of things. See your physician.
Groin pain and associated enlarged lymph nodes are almost always due to a recent or ongoing viral infection. Parasites, such as the filaria, which can cause elephantiasis, may produce these symptoms as well.