It may be annoying but I can certainly see why they do it as a business decision.
1) You are among the few who will walk out rather than go to the atm
2) Everytime a debit transaction is done at the till the store has to pay a fee
3) They can offer the convinience of an ATM, and charge the person who owns it "rent"
4) They aren't responsible for any transaction fees from the ATM on their end
5) Why would the ATM owner pay rent to compete with debit transactions at the till. If I owned ATMS I would certainly want some kind of "no compete clause"
In short AYMs make stores money. Most people will buy more not less, they don't have to worry about licensing, rental, setup or transaction fees, most sheep ... err people see it as a convinience. In a retail economy with thin profit margins as it is, or if you don't think profit margins are thin then in an economy where the store owner wants to make more money, these things add up to more profit in more cases.

You walk around like you're oh so debonair
You pull 'em down and there's really nothing there
I wish you would just be real with me