You're having this problem because the rectangle command draws the object in the xy plane, with z=0. Therefore, since I'm guessing your surface has z > 0, the rectangle necessarily falls underneath it.
What if you did something like this?
h1 = surface(M);
max_surf = max(M(:));
h2 = patch([0 3 3 0], [0 0 3 3], max_surf*ones(1,4), 'r');