A common way to save the integrity of the non sort columns is to add a dummy column, and then sort on it after sorting the primary. Here I'm adding a new dummy column to your datafile - using cat -n - which then becomes the column 1. Your primary sort is column 2; sorting on column 2 retains your numeric order. I hope this explanation made sense:
cat -n datafile|sort -k 2,2 -k 1,1 |
while read f1 f2 f3
do
if [[ "$f2" != "$f2_buf" ]]
then
printf "\n%s %s " $f2 $f3
f2_buf=$f2
else
printf "%s " $f3
fi
done