Minor league deals are something of a last resort for players an a low risk move for teams.
I'm going to talk about 2 players here who were signed for two very different reasons. The first is Dan Uggla who you mention in the question.
Uggla was cut recently by the Braves, and went unclaimed on waivers, that made him a free agent. Since he is already getting paid for the rest of this season by the Braves, any team that wanted to sign him only has to pay him the major league minimum salary (regardless of whether they sign him to a major or minor league deal).
The Giants, who need a second baseman, signed Uggla to a minor league deal (so they don't have to put him on their 40 man roster), with an opt out that he can take on August 1st if he feels like he will not make the big league club. Uggla can now go play for the Giants' AAA afiliate for a week or two and try to find his swing again. If the Giants want to keep him, they can bring him up before 8/1 and his opt out will be voided, they have a cheap 2B option who is better than the ones on their current roster. If they don't want to call him up, he can maybe do the same thing somewhere else.
This is something of a win-win for both parties, since Uggla is already getting paid this year by the Braves, he only has to worry about finding a team to play with (and possibly salvage some value to resign elsewhere next year), and since the Braves are paying the bills, this is a very low monetary risk for the Giants.
The other contract I want to look at is that of Tsuyoshi Wada. Wada was signed from Japan by the Orioles, but never played for them, he had Tommy John surgery. This past off season he was signed to a minor league deal with the Cubs, who released him and resigned him again (in what is believed to be a contract restructuring deal, I don't think all the details were made public).
Rather than his contract being covered by another team, the Cubs are paying his full minor and then major league salary. He was signed because he was a guy who could rehab and possibly be something special and at the very best be a tradeworthy asset come July or a potential full time rotation candidate next year.
Consistent with that approach, he was called up this week to make his second big league start (it wasn't anything special). However, it's believe that the Cubs will trade him if they get an offer or try to keep him for next year.
This kind of rehab deal appeals to teams like the Cubs who are not likely to contend for the year and need assets that can fill roster spots or bring back even marginal prospects in trade, and it appeals to players because it can keep them him US professional baseball rather than them having to go somewhere else to finish their rehab and get back onto the diamon (Wada likely would have had to return to Japan if he had not been signed).
The Uggla strategy is all right for a team that sees itself in contention and has a hole to fill as long as they can find out if their hole is filled prior to the trade deadline. The Wada strategy is that of rebuilding clubs. This isn't a way to restock your farm system as the kinds of players who sign minor league deals are not usually the kinds of prospects you reload with (though they can occasionally break out and be included int trades for them. See what the Cubs did with Jason Hamel this year).