Firstly you have not failed as a mother. I do not believe that it is possible to spoil a tiny baby. You have followed your instincts and if your child is needy then by giving your baby what she needs through love and comfort is, in my book, being an excellent mother.
It is a myth that formula fed babies sleep better than breastfed babies. I formula feed and by no means am saying that formula feeders should feel guilty (there's enough guilt-trippy comments thrown around to us mums that choose to ff), but breastfeeding is best where it is possible to do so, so well done for sticking with that despite the negative comments from people who should be supporting you.
Yes, co-sleeping is not as safe as your baby sleeping in their own bed, but it can be done as safely as possible by following simple advice: www.nct.org.uk/parenting/co-sleeping-safely-your-baby
When your baby gets a little bit older, perhaps you could try some sleep training techniques. There are different methods and there is no right or wrong way of doing it, just what you feel comfortable with. But you will need support around you as sleep training is not easy. Methods include pick up put down, the chair method (where you put them in the cot, perhaps even have your hand on their chest until they fall asleep but you sit next to them on a chair, but over time you gradually move the chair away), no cry solution, cry it out, controlled crying.
I do understand the feeling you get though battling with these thoughts of "what if I did X from the start, baby might not be doing Y now" as I took the decision to start cuddling my baby for every daytime nap as he just wouldn't sleep in his moses anymore in the day and was getting really bad colic in the evening which I was convinced was due to poor naps, and now he sleeps great (if anything I worry he sleeps too much now in the day!!) but he won't sleep in his cot whatsoever apart from at night time. However, remember this: we, as mothers, do only what we think is best at the time and if we do make wrong decisions, we are learning from our own experiences - there is no rule book we can follow in this game, just our instincts and what is right or what we feel is right for our babies.
Good luck on your quest for resolving this in the future, but please do not beat yourself up over this and just enjoy your cuddles with your baba while you can as they grow up so quick :)