Are you sure it is nematodes? They are free-swimming, and usually will not adhere to the sides. Planaria however, are attached to the glass, and not free-swimming. Regardless, both are harmless, and some fish will eat them, they are just very unsightly.
Keep cleaning the gravel good and keep low on feeding. How severe are they?
I think some copper-based meds will kill them, but no since in adding uneeded meds to your tank if you don't need to.
Live in the Western MD/West Virginia/DC Metro Area?
Join our very active regional forum Here
Like the advice someone just gave you? Add to their reputation! Click on the balance icon underneath their username and let them know.