There are a few things that might have caused that.
1) you may have not fermented it long enough - most brewers will leave it in the fermenter for at least 3 weeks which gives the yeast lots of time to 'clean ' up the beer and compress any sediment in the bottom of the fermenter. Once fermentation is finished many brewers will also cold crash the fermenter for a few days (i.e. put it in a fridge) which is a very fast and effective way of clearing the beer and compressing the sediment in the bottom of the fermenter.
2) While many brewers will advise you not to bother using a secondary fermenter because it increases the chance of oxidation and introducing infection, and it also makes more work - I find that using a secondary reduces the amount of sediment that ends up in the bottles because of point #3:
3) you may have stirred up a lot of the compressed sediment on the bottom of the fermenter when you racked to the bottling bucket. Best practice is to move and agitate the fermenter as little as possible when you are going to rack to the bottling bucket. Also be careful that you don't push the racking cane way down into the trub when racking. Try to rack from on top of it as carefully as you can. I purposefully use a secondary to eliminate most of this gunk that I inevitably get from the first stage of racking.
4). Due to the priming sugar consumption from the yeast you will inevitably have some extra yeast /sediment in the bottom of your bottles. Keep them upright in the fridge and the longer you keep them cold before opening them the better any yeast/sediment will compress on the bottom. Avoid agitating them and pour constantly until there's about 1/4--1/2 inch of beer left in the bottom of the bottle to avoid stirring up that sediment and getting it into your glass.
Fail at one or two of these steps and it's not the end of the world. Fail at all of them and you will likely have lots of floaters.