Writing critically about previous work
Every published work has at least a few sentences that criticize previous published work or a collection of them. They are often constructive, in the sense that they generally point limitations and how to build upon them, in sentences that are similar to Dawn's comments. 

Now, I have no idea what kind of criticism you made, but a common pitfall for junior academics (and I am one myself) is to end up over-generalizing a claim, both when discussing their own results and when criticizing other's work. The other student may have fallen into the former trap, by over-generalizing their result (you said they presented incorrect conclusions). But you may be falling into the latter trap by being overly critical and, maybe, not having sufficient data to back up your claims that the other student's conclusion is wrong. Your advisor may have detected it by simply glancing over your text, which is easy with enough experience. 

In general, I advise people to be very cautious of what they are criticizing, especially if it is not a limitation of the other study, but something they got wrong. It is often a better idea to talk to the other person before openly criticizing them. The other person is likely to know their work much better than you do. If you manuscript falls into their hands for review (which probably won't be your case, but still), and you are wrong, it's a strong argument for rejecting it.

Now, if you still feel that you are right, that you are not over-generalizing, that you have sufficient data to back up your claim, that it would be relevant to include it in your thesis, then ask your advisor. Explain how this criticism would be important to your thesis (or paper in preparation), and ask how you should include it without being overly critical.

If it is not relevant to your work, it would be weird to see an unrelated note/section discussing how someone else's unrelated work is incorrect, even if you spent 18 months on it (which is a lot of time, and certainly unfortunate, but these things happen, and you should talk to your advisor and other people about how to avoid spending large amounts of time without progress).