OK, I will try to tackle one after the other...
I suggested to stop first at Dead Sea since the Dead Sea area is the closest first stop when coming from the Israel border crossing - to my knowledge, you can check it again.
I do not know regarding the border crossing, but heard a long time ago that it can take a very long time - especially on the way from Jordan to Israel.
Definitely do not drive from Jerusalem all the way to Petra, I recommend to go to Dead Sea as I believe it is closest. Ma'in may not be much further, but I am not sure of the route you will be coming from. This is the reason why I placed the Dead Sea at the beginning of your stay and Ma'in at the end - both are relatively close to your crossing towards Israel.
Quite a lot: The visit of Petra and Wadi Rum will be tiresome, but can be done. The way I would do this: Drive from Dead Sea (or from Ma'in if you're coming from there) directly to Wadi Rum and then go to Petra from Wadi Rum. You can still visit Petra the following day in the morning and continue your trip.
Karak castle - yes it is on the way to Petra and you can stop there.
You can basically swap Ma'in and Dead Sea around if you wish. I felt Dead Sea is easier to get to that Ma'in. Ma'in is somewhat remote when coming from Israel as far as I can tell.
I would add one night in Amman. It would make your itinerary more manageable and you can still see the few sights in and around Amman - you could even do Jerash from there instead of from Dead Sea. And you can get the feel for the city with the Amphitheatre and all the surroundings.