To stay optimistic, you need to understand that most people are simply not going to match with you.
Even if you were able to have a fun interaction with someone on a dating site that led to a few dates, there are still no guarantees that you will both end up in a long-term committed relationship.
Now that you have had this kind of experience with people that you have matched with on a dating site, you should have a good idea of what to look for.
Repeatedly matching with people who mislead you into thinking that they are looking for a serious relationship only to discover that they are just looking for friends or want to have wait and see period can be incredibly tiring.
You already know what you want and you may have already spent a precious amount of quality time interacting with this guy on the online dating site only to have him come up with this excuse.
When you asked to exchange numbers or he simply volunteered it, he may have given it because he felt that it was the appropriate thing to do at the time.
The both of you may have already had several conversations on the dating site before you requested to exchange numbers or he volunteered to give you his number.