Why would a restaurant put a temporary charge on your credit card?

Assuming that you are not a cheapskate, you will be leaving a tip. The restaurant only places the temporary authorization there to make sure enough available credit in place to cover the tip. Shortly after the credit card is closed out on their system, the authorization is removed. Usually when they batch their system (weekends can delay this).