When is it appropriate to serve shrimp with the tail still attached?
It's quite common. I had Garlic Prawns (shrimps) in a faily exclusive restaurant in Darling Harbour (Sydney) last weekend, with shells still attached to the tail.

From what I can gather it's mostly about aesthetics. I suspect there is some truth in the idea that it gives the impression of more shrimp for your money as well.

Some also argue that it adds flavour during roasting or sauteeing.

It should also be noted that many people will in fact eat the tail. (The entire shrimp is edible.) It's not my preference, so a simple pinch at the base of the shell and the shrimp will slide right out. (They usually - or at least should - provide you with a small finger bowl filled with water, and sometimes a slice of lemon, when you're expected to remove the tail shells yourself.)