Newly replaced BB loose after only 25km I replaced a broken shimano BB-UN26 bottom bracket yesterday. After only a 25k ride the crankset has some play and has started to wiggle a bit. It looks as though the bottom bracket is moving with the crankset. 

Last time I replaced the BB it lasted 8 months. Crankset was replaced at the same time. 
Is it a defective BB, did I do something wrong, or do I have a bigger problem?
I would recommend first checking on what Noah recommended: checking that the crank bolts are tightened down to the proper torque. If they are, I would start with the following steps:


Remove the cranks and bottom bracket, and check the adjustable bottom bracket cup (on the left side of the bike, when you are sitting on it). A UN-26 will have a plastic cup, which is usually a light tan color. If you've over- or under-tightened the adjustable cup, it can crack fairly quickly. This is especially true for heavier riders, or riders who tend to "mash" on the pedals up hills. This cracking will allow the bottom bracket to move in the frame, and it will wear quickly because it is not fully supported.
If the adjustable cup is not cracked or loose, move on to the fixed cup (on the right side of the bike). If it is easy to remove (being only finger tight, or taking almost no effort to remove), the bottom bracket will be able to move in the frame when you are pedaling. It will wear quickly for the same reason as #1: it is unsupported in the frame.
If neither cup is loose, or the non-drive side is not cracked, the bottom bracket shell (the part of the frame that the bottom bracket threads into) faces may not be properly aligned. The lip of the drive-side cup rests against the bottom bracket shell face. 


Ideally, both faces will be parallel to each other. With traditional cup and cone bottom brackets, this was much more critical than it is with modern cartridge bearing bottom brackets. However, if the faces are far enough out of alignment, even a modern bottom bracket will wear quickly.

If you suspect that the faces are out of alignment, you may want to take the frame to your local shop to have the bottom bracket faced. This will cost between $20-$40, and will typically also include the chasing of the bottom bracket threads as well.
Finally, you may want to consider a higher quality bottom bracket. The UN-26 is entry-level quality, but if you are riding regularly and/or in inclement weather, it will wear out quickly regardless of installation quality. 


Shimano makes a UN-54 bottom bracket that uses higher quality bearings and an all-metal construction. 
Another good option are Tange bottom brackets, which come in a variety of sizes and use high quality bearings.
If cost is not a factor, the ne plus of bottom brackets are made by Phil Wood. Truly a "set-it-and-forget-it" product, you will have a hard time wearing out one of these. Should be professionally installed, but can last a lifetime.