Covering Up, Petra
There are two reasons to cover up, no matter where you are in Jordan.
1) Jordan is a conservative country, and unless you are in the trendy Shmeisani area of Amman you won't see anyone, male or female, wear shorts unless they're homeless, mentally ill or small children; locals consider shorts to be underwear. Arabs who dress in this way would be called out and criticized by strangers; Westerners who do so might get cat-calls, get stared at, followed, or harassed (especially if they're women), but the latter two are rare. Even if this is fine with you, think of what you're missing; loads of Jordanians would avoid someone who was dressed so strangely, and many people older than 30 would consider it personally disrespectful, as though you're implying they aren't worth getting dressed for; you'll get worse treatment in shops, restaurants, government offices, etc...
2) Jordan is a semi-arid country, and by covering your skin you are reducing the risk of dehydration by limiting the evaporation rate of sweat . Those who don't cover up, and don't live in hot, desert-like environments will likely get heat exhaustion, no matter how much water they drink, if they're outside every day, and especially in places like Petra. the majority of nausea, stomach cramps and diarrhea symptoms are not from drinking the water but from heat exhaustion.
Petra is very popular tourist site also for the local Jordanians as well as for the other neighboring countries, you will see lots of Muslims dressed with their tradition clots, however, for westerners there is no any real restrictions, or at list I didn't saw any, maybe they wouldn't like it if you hang out with a bikini here, but on the hot days of most of the year here, you can fell freely wearing your usual summer cloths even if they are shorts and small tops, just be sure nothing is popping out by mistake... ;-)
Although in my Petra photos Alex and I are wearing shorts, we didnt remove our skirts until we were actually in the site of Petra itself, and when ever we came across local people we coverd up.
It is a Muslim country, so apart from the respect issue for their culture, it helps save you a lot of unwanted attention from over friendly men.