See here for an explanation of the v3.1 on Raspbian issue:
TLDR: it is a broken/incomplete version built by the RPi team outside of Sam’s control, which of course unfortunately provides a poor user experience for users attempting to use the latest Sonic Pi available through official Raspbian channels.
As nlb has alluded to, Robin has kindly managed to make the most recent release (v3.2.2) available on his own website. Feel free to give that one a go