A number of possibilities . . . axle misalignment, absence of right-hand spacer on reassembly, sticking caliper piston . . .
My first step when removing rear wheel . . . unbolt caliper, push piston in as far as possible to facilitate reassembly . . .
Sandwich disk into caliper, after everything lined up.
In your case, since you did nothing to the pads and didn't touch the brake pedal, mis-assembly seems likely, to me. Been there, done that . . . rear brake assembly is really cryptic to me, somehow. Suggest you disassemble/reassemble, with careful attention to alignment of axle, being sure the rear axle spacers are all present and in the right order (easy to get 'em mixed up).