Hi,
You have posed a question that has puzzled me over & over, for the last four iPhones that I have owned to this date.
First, I can confirm that my SO's 5s does NOT rattle when I perform the test as described (I have done it so many times, she probably thinks that I am a loon, LOL). That being said, I have personally owned three 5s devices to this date and ALL of them displayed the same problem. She is just that lucky (being married to this awesome guy, you know #joke).
The bottom line, as per my experience, is: while it is not the case with all of the units, it is NOT a quality flaw. It appears to be an acceptable design of the 5s.
So, go on & enjoy your device.