Generally when you get cash - it is considered cash advance. So ATM, casinos, currency-exchange places, buying travelers' checks, and money transfer/check cashing agencies are the standard suspects in that regard. Funding paypal account may also be considered as cash advance, and in some cases - buying gift cards (depending on the merchant and type of gift card).
There are several reasons for this:
Cash cannot be recovered. Once you got cash - no-one can chase you to take it back. So it is a much higher risk - they may end up absorbing fraud activities if the merchant can prove to have done the due diligence (which most of them do).
It is also a higher cost to the companies - they need to pay it to the merchant faster. Usual purchases may end up in the merchant processor's pocket for significant amounts of time (I know of some cases where it can be 30 days), but not so for cash advances. It also adds to the risk - since even if a charge-back is successful, the money has already left the building and will have to be recovered.
Because they can. People who use credit cards for cash advances are usually either desperate or financially illiterate (and in many cases - both). If the companies can earn money for the service - why not?