There are several possible causes for your insomnia
. It is certainly possible that not playing sports has something to do with it, as previously you may have relied on the exhaustion from playing hard to fall asleep. Now that you are not playing and have more energy, you may need to seek out alternative ways to get exercise. Even just 30 minutes a day of light aerobic exercise, such as jogging, should improve your sleep cycle.
You should also look at whether you are taking any substances that could interfere with sleep. For example, if you drink a lot of coffee or soda, these are well known to interfere with sleep. You may want to try cutting these out entirely and see if this has an effect.
Another possibility is that your sleep cycle has been messed up by irregular habits (for example, sleeping late and staying up late on the weekends but not during the weekdays). One helpful approach is to sleep the same on all days of the week, including weekends (for example, get up early every morning, go to bed at the same time every night).
If these tips do not work, you should go see your primary care doctor
for a checkup and more suggestions.