I guess because the Necron knew that they couldn't fight the Tyranids alone; and yes, they could have returned to their Tomb world to wait for the Tyranids to leave - but what would they return to? A world denuded of all organic material? Further, if that's the way the Necron operate, then forseeably they would never engage anyone, since returning to a tomb to wait until things were more suitable for them would result in no battles - just 'terrorist' style raids.
Ultimately, I find it fascinating that not all Necrontyr were of the attitude that they must wipe every living thing out - why should they be? - and therefore it is likely that some Lords would have preserved engrams where their personalities continued their neutral or a more balanced mindset. Such as the Silent King making a strategic decision to briefly ally with the Blood Angels.
However, I understand your view point and do not think that you are wrong - you are entitled to expect the background to be more in sync with how you perceive the 40k universe to be I just like morally grey characters, who aren't always so despicable.