Isn't it injustice on behalf of editor to assign article status as "under review" when actually it is not? This happened to me second time that my article got rejection after several months of review when article was not under actual review. Ten months ago I had submitted my work to mathematics journal of Elsevier, one month after submission my article status changed to under review, and I started waiting for review outcomes, but after ten months of review, editor responded: "I have checked your manuscript with care and I come to conclusion that your work is not suitable for publication in our journal". How could they take 10 months to decide the eligibility for aim and scope, why they put "under review" label for article when actually it is not under review?
"Under review" may include the review of the editor or editors, so in this case it may be under review. It also may be (as Maarten commented) that the paper was sent out and the reviewers indicated that the paper was not suitable for that journal without comments. 

A few years ago I had a terrible experience where a journal had a change in editors and management and they lost my paper. I had no idea and they would answer my emails about the paper, but never get back to me about why I couldn't get any information about my paper. This went on for about a year. Ultimately, it worked out, but remember that editors and reviewers are often volunteers, so some may not put their reviews as a priority in their schedule. This isn't fair to the authors, but it is the truth. I'm sorry you dealt with this frustrating situation, but I find that these things are a lesson learned and if anyone asks you about your thoughts on submitting to that exact journal, you know what to tell them.