Can my master thesis be a part of doctoral dissertation of the Ph.D student I worked with?
For both a masters' thesis and a PhD dissertation, there needs to be a core piece of work that is primarily the student's work.  Collaboration can certainly be fine, but there needs to be a core idea that is "yours" in order to get a degree out of it.

It's at least conceivable that you and the PhD student were collaborating on something that had only one degree-worthy idea in it, and therefore a tough decision had to be made.  

It's also possible that this is being used as an excuse for something unethical like cheating you out of your masters' project.  

Whether this was legitimate, or not, we can't really tell from the information given.

It does sound that the situation was, at least, not handled very well.  The supervisor has oversight of both your projects and should have prevented your projects from overlapping too much, before you wasted lots of work on something. Also, if you contributed significantly to the eventual PhD project, at a minimum you should still get credit for this (e.g. with paper authorship).