Because that is what the function is for, to produce random integers.
You are incorrect that it only accepts positive scalars: the first argument can be a two element vector of minimum and maximum integers for the range, such as
to produce a 5 x 5 in the range -50 to +100
For continuous values in a uniform distribution, use
rand(SIZE_OF_ARRAY) * (MaximumValue - MinimumValue) + MinimumValue
For discrete values that are non-integer or not contiguous, see randsample()