There are numerous reasons why Sakura isn't well written. First off, her infatuation with Sasuke is simply ridiculous. Sure, I can understand it occurring at the beginning of the series(she was only 12-and a lot of us are stupid at age 12) but it continued on in Shippuden. In other words, she didn't mature. The danzo arc was killer for Sakura's character. She thought she could take out Sasuke alone, and used her comrades as nothing more than tools(and then failed). It's painfully obvious that her thinking about Sasuke messed up her thought process. Her fake confession to Naruto was also incredibly stupid, especially given how Naruto saw through the charade and told her off. You don't play with someones feelings lke that. Then there's the current arc, where she was thinking about "sasuke-kun not caring" in the middle of the worst war in history. In other words, she has barely matured at all with regards to Sasuke, and it's made worse given how sasuke doesn't give a flying fuk about her!
The second problem with her character is that she has ZERO direct ties to any of the main villains.(unless you count sasuke, but he's an anti hero) This is a big problem, as the people who play a role in the villains defeat all usually have connections to them, which leads to interesting dialogue. Naruto was connected to obito since they both wanted to be hokage but chose different paths, Sasuke is connected to this since he's an Uchiha, and Kakashi is friends with Obito. Sakura isn't connected to them in the slightest.
There's also the added problem:What do we really know about her OUTSIDE team 7? What are her views on the shinobi world? What does she think about the will of fire, or the curse of hatred? What are her goals?(outside of team 7) And finally, she doesn't have much fighting feats, and this is a shonen manga which focuses on fighting. Being a medic means that all the work is done on the sidelines, which is great for a SIDE character, but the main characters are meant to be in the spotlight, and medics don't take centre stage in the action. That's the bottom line, and why Sakura's character isn't the best.