You have to understand that top journals have to make harsh decisions. They receive a lot more papers than they can publish. If every paper would be sent to a referee, then they would receive more positive reports than they could accept, and then they would have a huge backlog. Many journals do the following:
The editor in charge makes a quick assessment of a paper and he or she decides whether the papers should be sent to a referee or returned to the author. This should be a quick process, but it is not always the case. The editors are regular people who work as a faculty and they do the editorial work when they have time.
The editor sends a paper for a quick opinion. A person who is asked for a quick opinion is not asked to referee the paper, but just to have a quick assessment of the quality of the results (without checking the proofs). Then based on this opinion the editor decides whether the paper should be refereed or send back to the author.
In that case, the opinion is often informal and therefore not forwarded to the author.
Since it took 3 months for your paper to be rejected, I suspect that the opinion 2. was used.
Three months is not much. Many papers are rejected after a year or more. You should not feel bad. If you still think this is a good paper you should send it somewhere else. However, you should not send it to a journal that, in your opinion, is much beyond the level of the paper, because:
- That would not be fair. If such a papers gets accepted in a top journal you get credit for a paper that does not deserve it.
- You intentionally lower the quality of the journal.
- You risk that a referee will keep a paper for a year and then reject it.
I know it is very difficult to assess the quality of your own paper especially for someone who does not have much experience (that is a general statement and I do not know if it applies to you). Anyway, make the best judgments you can (perhaps ask for an opinion) and submit to the journal that is at an appropriate level.