There are three reasons that I've seen mules dropped away from the mineral line in competitive play: Manner mules
By far the most common reason is that a Terran player has decided that they've won the game, that it's obvious that they've won the game, and the other player should have realized they've lost and gg'd out already.
Throwing down mules away from your base in that situation says "I've won so big, look at me throwing away resources, because I don't even need them to crush you completely."
It's considered impolite or (in the common SC2 phrase) "bad manner", hence the name.
Forcing the enemy to shoot their own units Facing off against another Terran, it's possible to cause the enemy's tanks to kill each other by landing a mule in the middle of a group of sieged tanks...
the tanks target the mule, and kill each other with the splash damage.
Repairing mechanical units When an important mechanical unit or group of mechanical units (most often a Thor, but sometimes a group of tanks) is severely damaged far from the players base, that player can repair it by sending down a mule, without having to wait for an SCV to cross the map, or retreat the unit(s) back to their home base.
If the unit(s) repaired are important because of their strategic position, repairing them can be more important than the loss of minerals due to dropping a mule away from the mineral line.
gaming.stackexchange.com/users/18830/Theodore Murdock
MULEs dropped on the battlefield, especially near the end of the game and nowhere near anything that needs repairing (e.g. a bio ball) after a large victory are known as Manner MULEs , essentially an "in your face!"
with units.
This meta-gaming is usually to try and fluster the opponent, especially in a series of games where they would play another game minutes later.
gaming.stackexchange.com/users/2259/Nick T
During the game, Mules can be used to repair units in the field and can get to the units in need of repair faster than SCVs if they have to run a long distance.
I've used them and have seen other players use them during battle to repair damaged thors and tanks without having to wait for SCVs to run all the way out there.
And, as I've learned from the other answers here, and on subsequent research on http://wiki.teamliquid.net/starcraft2/MULE , they are also used to humiliate or intimidate an opponent.
gaming.stackexchange.com/users/2288/Jed Daniels
In addition to being able to repair, Mules will sometimes draw enemy fire.
For the same reason that sometimes people will send their workers into battle to soak up some of the damage, sometimes Mules can be used for the same purpose.
I am not expert enough to know how effective this is, but a Mule has 60 hit points.
If it can soak 60 damage that would otherwise kill unit(s) costing > 200ish minerals, I would think this would be more effective than just having it mine.
gaming.stackexchange.com/users/3241/Wikwocket
Mules can also be used to perform a terran "force field" and placed on hold position.
This can make banlings/lings take a longer path to reach the attacking terran units, or absorb broodings and mess with their pathing.
gaming.stackexchange.com/users/31483/dick
I have two additional uses for mules.
Scouting.
The mule can be dropped anywhere where the player has line of sight.
Which can be achieved with a scan.
I will sometimes scan an area, and then drop a mule into it.
This gives me a unit which can scout the area beyond the perimeter of the scan, or keep tabs on an important find.
Consuming Banelings.
A good tactic for fighting Zergs who have a lot of Banelings is to scan, and then throw down some mules right next to the Banelings.
Each MULE will absorb 2 Baneling hits.
Which costs my opponent 100 mineral 50 gas and 1 supply in units.
This is economically viable considering that the MULE would harvest 270 minerals if used on my mineral line...
Or give me 100 minerals if instead I were to call down supply.
gaming.stackexchange.com/users/80431/Benjamin
I have seen many pro players dropping mules after and during battles. Sometimes they use scans instead.  This seems counter-intuitive, I mean they could get a ton of minerals for that.  Why do they do it? MarineKing does that very often.
Why do Terrans drop MULEs in battles?
gaming.stackexchange.com
<starcraft-2><starcraft-terran>
gaming.stackexchange.com/questions/68072
gaming.stackexchange.com/users/10933/ayckoster
A Terran player decides they have won the game when it's obvious they've won and the other player should have realised they've lost. Mules can also be used to perform a terran "force field" and placed on hold position.   While the most common usage of MULE in battle is to provoke an enemy, there are other usages too.
The community suggests few reasons behind MULE dropping in battles.