I don't think he was robbed but based on the judging criteria he should have won. The judging criteria states that harder strikes count for more than slightly more volume, Dillashaw and Cruz landed almost the same number of strikes and there was very little grappling, Dillashaw landed the hardest shots of the fight and was the aggressor so based on the Unified judging criteria Dillashaw won a close fight.
It seems to me that Cruz somehow got points for dodging(you're not supposed to award points for defense).