The sorting is left to right (as viewed), top down (as seen in field list).
So, if you want doors grouped by room, you need to place the room number first (drag it up to the top of the list), then ID.
Since you already have the 'flag' set for room number, that means that the room number will not be repeated on each row, as doors A, B, and C are listed...but only on the line with the first door (A). If you want it on every line, then clear the title flag (looks like a flag in your setting screenshot).
There is no way to have them sorted the way you want and yet to have the door ID appear first.
Cheers,
Karl
One of the forum moderators
AC 28 USA and earlier • macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB