The reason det() doesn't return zero for this matrix is because the floating point errors in the computation of the determinant. If det() computed the determinant using the textbook formula, the result would, of course, be zero.
D0 = X(1,1)*X(2,2) - X(2,1)*X(1,2)
But det() uses a more general algorithm as shown on its doc page and repeated here. This algorithm like any other is subject to numerical error