Hi Young,
The basic answer is the same as my earlier note to Subhi. There is no "problem" behind this; it's simply due to the way the method works. I am not a statistician so I'll give a bit more of an intuitive reply. Perhaps someone else with chime in with a more rigorous follow-up.
To give a bit more insight, having so few genes in the dataset means that very few Gene Sets - and very likely none - will wind up matching your data simply due to the extremely small number being barely above the matching threshold. As well, note that there is typically a large amount of information in the rest of dataset that, even if if it's not at the top of the list, is nonetheless still important to the analysis.
Recall that Gene Sets typically represent biological pathways or processes of some kind, comprising multiple genes or features. Thus, even if your statistical method is capturing the Top N Most Relevant Features, there are still some other (typically large) number of somewhat-lesser features that ALSO contribute to these pathways or processes. Focusing on just the Top N loses the additional information present in the rest of the data set.
By instead looking across the entire genome, the information from all the genes contributing to the pathway / process will be included, thus distinguishing which is most enriched overall. In a pathway analysis, it's important to have information from multiple participant genes - as many as possible - in each pathway.
I hope this helps.