Split the file.txt by space and set the output field separator as tab. Print a random number followed by the line of the file.txt and sort the output by the first column (random number).
awk -F ' ' 'BEGIN {OFS="\t"} {print rand(),$0}' file.txt | sort -k1,1n