Why does LEGO sell minifigures randomly?
The minifigs are what is known in the retail trade as 'blind-packed collectables'.

They're sold at 'pocket money' prices in newsagents and bookshops at aisle ends or counter-tops. The idea is to encourage people (mainly children but adults too) to try and 'collect' a complete set. The opaque bags encourage this by making this goal harder to reach, and therefore more of an achievement - revealing the contents would take away a lot of the fun.

The sealed bags also lead buyers to end up with 'doubles'. If you keep these, then the Lego company gets that extra revenue - whereas if you try and swap them, then that helps to spread the word about the product and gives you an incentive to encourage your friends to start collecting them too.

The minifigs are also produced in un-even amounts. This makes it even harder to collect a complete set - and also means that Lego can save money by making less of the more expensive to manufacture minifigs.

So - whilst you might find the random element frustrating, you can see how it makes financial sense to Lego. And if you stop and think about it, would simply being able to pick-and-choose which minifigs you buy be quite so much fun?