The two forms of roundworm that are most commonly encountered in the United States are Ascaris and Trichuris. Both infections are relatively benign in most adults, although as you experienced they can sometimes cause stomach discomfort. Fortunately, as you experienced, they are easily treated with simple oral medications.
Both Ascaris and Trichuris are mostly human parasites. The eggs of the worms are passed in the feces, and they can be transmitted to another human if you accidentally ingest material contaminated with these feces. Also, the pig Ascaris roundworm can be transmitted to humans (this commonly occurs when people use pig feces to fertilize their gardens, for example). Both infections are uncommon in the United States at this point, mostly due to improvements in sanitation and hygiene infrastructure, although they are very common in developing countries around the world.
If you were recently traveling in a developing country, then that is most likely where you picked up the infection. Gardening or working with the soil, and then not adequately washing your hands or eating produce contaminated with soil might be other sources of infection.
Fortunately, these infections don't usually cause any long term problems, and it sounds like you are cured! However, you should discuss with your doctor
to confirm this and to answer any other symptoms or questions you may have.