Female dogs do need to be kept quiet after desexing, for a few days at least. They have undergone quite a substantial surgical procedure, removing the uterus and ovaries. Depending on the Vet, and how the procedure is done, where the incision is may vary. At the very least she will have stitches and it takes time for the wounds to heal. By reducing her activity, this lessens the chance of the stitches breaking, promotes healing (as dogs heal when they sleep) and reduces the stress of pain caused by physical activity.
The amount of activity your dog can do will increase after a few days, but it is a good idea to reduce any strenuous activity for at least a week.
Bring her home and make her bed nice and cosy and keep her in a quiet, preferably darkened room with the door closed. When you take her out for the toilet, keep her on a lead, so she can't attempt to wander. At this stage, she'll, likely, still be sleepy from the procedure and the drugs. So keeping her locked away like this will give her a good place to just sleep. Some people use an internal laundry, as it is a small space, I prefer to use a small bedroom.
Keep your dog inside for the duration. If you have an enclosed yard, it should be ok to let her out off lead, but stay with her and bring her in after she has relieved herself and had a small sniff around. If she needs to be taken out into an area with other dogs, or no enclosure, she needs to be kept on leash at all times.
If you have a small place, there is less need to restrict her movements within the home, but for larger houses, it can be a good idea to keep her in one or two rooms. The issue with this, is you don't want her to feel socially isolated from her family.
You dog can have more freedom, doesn't need to be restrained within the home. I would keep her indoors and let her have longer supervised periods outdoors. For 20-30 minutes at a time. I wouldn't be taking her on walks at this stage.
It is important to follow any instructions given by your veterinarian.