There is no general solution since the values in column 1 may not sufficiently vary. For example, what if all of the values in column 1 were identical? Or what if the values in column 1 were [1;1;1;2]?
Assuming the data in column 1 sufficiently varies, you can use randperm to randomly permute the rows of the matrix. But that doesn't guarantee a lack of consecutive identical values. You could pemute the rows within a while-loop that continues to apply random permutations until the condition is satisfied or until all possibilities are exhausted, though this approach challenges the notion of randomness. Here's a demo. If there are no permutations that satisfy the constraints, a warning is thrown (you can change that however you'd like).
M = randi(3,8,3)
M =
3 3 2
3 3 3
1 1 3
3 3 3
2 3 2
1 2 1
1 3 3
2 1 3
nPossibilities = factorial(nrows);
if any(diff(M(:,1))==0) && count <= nPossibilities
warning('No permutations result in non-consecutive values.')
disp(M)
3 3 3
1 2 1
3 3 3
2 1 3
1 3 3
3 3 2
2 3 2
1 1 3
Replace the demo matrix with M = randi(2,8,3) to see the warning.
Note, if the matrix has many rows and the values in column 1 do not sufficiently vary, this could run a very long time. For example, a matrix with 10 rows has 3,628,800 possible permutations. If you expect to have this issue, you'll need a smarter solution that initially determines whether a permutation is possible.