Consider discarding the bed frame along with the headboard and footboard to save you room and trouble. The frame and boards are usually only aesthetic in nature and will need to be removed on a daily basis if you're storing the bed against the wall while still using it at night. All you need is a mattress and box spring for sleeping purposes.
Place a firm wooden board between the box spring and the mattress to provide the mattress with additional support. A queen mattress is wider so it is more likely to buckle when it is being stored sideways against the wall. Buckling can damage the mattress and the board helps prevent this.
Tie a rope around the box spring and mattress to keep them together. This helps prevent the bed from tipping back over while it is being stored.
Brace a heavy object against the base of the bed on the floor or jut the bottom edge outward slightly so the bed will stay against the wall without tipping. Store the mattress length-wise since it will likely fit better and is less likely to buckle that way.
Cover the bed with a decorative blanket or comforter to make it look nicer while it is stored against the wall. Store the pillows from the bed on the top edge of the mattress under the decorative cover.