The Platonic Socrates did not claim that he knew nothing.
When asked by Chaerephon whether there were any wiser than Socrates, the Delphic Oracle replied that there was no one wiser (Apology, 21A). This puzzled Socrates, who thought he had no wisdom at all. He questioned the reputedly wise, then the poets, then the craftsmen or artisans. He concluded, not that they did not know anything but that they did not know anything 'fine and good' (kalon kagathon : Apology, 21D). What he means is, I think, that they lacked knowledge of the really important things, those that concern human well-being and virtue. Their lack of knowledge would have been revealed - exposed - by their inability to analyse these matters adequately under the impact of the Socratic elenchus.
Socrates himself was in no better position but he knew that he lacked knowledge of the really important things, while others did not. His wisdom consisted in his recognition that he lacked this knowledge.
Certainly the early Platonic dialogues, which are widely thought to be not too far divergent from the views of the historical Socrates, are abortive. The Charmides, Laches, Lysis, for instance, end in defeat. No satisfactory definitions are reached. Socrates has no knowledge to bring to the table.
Extended speeches are rare in the early Platonic dialogues
Now, in these early dialogues there is much adversarial question and answer but The normal pattern is :
The interlocutor, "saying what he believes," asserts p, which Socrates considers false, and targets for refutation.
Socrates obtains agreement to further premises, say q and r, which
are logically independent of p. The agreement is ad hoc: Socrates
does not argue for q or for r.
Socrates argues, and the interlocutor agrees, that q and r entail not-p.
Thereupon Socrates claims that p has been proved false, not-p true. (Gregory Vlastos, 'The Socratic Elenchus', The Journal of Philosophy, Vol. 79, No. 11, Seventy-Ninth Annual Meeting of the
American Philosophical Association, Eastern Division (Nov., 1982), pp. 711-714: 712.)
If 'p' is a definition of courage or friendship, say, we are none the wiser about what courage or friendship is; all we have established is that it cannot be defined as 'p'.
Extended speeches belong to the middle and late dialogues
Such speeches occur, not 'all the time' (if that means frequently or constantly), in the middle Platonic dialogues such as Phaedo, Republic, Phaedrus : there is much extended discourse by Socrates in the Republic in particular. In the late dialogues such as Timaeus and the Laws there are long speeches but Socrates does not make them : Timaeus does in the dialogue of that name, and the Athenian Stranger does in the Laws - a dialogue in which Socrates does not appear.
Why the change? Universal consensus is not to be had but the majority view among scholars is that while the early dialogues repeat or recreate the historical Socrates' method of question and answer, in these later dialogues Plato elaborates his own ideas and arguments. The 'Socrates' of the Republic is Plato speculating under Socrates' name. Socrates' name may - though we can never know - be retained because Plato derived his initial philosophical impetus from the elentic historical Socrates and is honouring the growth-point of his philosophy.
A point about the Socratic speeches
A final point should be made. The Republic's Socratic speeches are not dogmatic orations. Everything is tentative. The analogy of the sun (VI.507D), the line (509D), and the cave (VII.514A), an epistemological and metaphysical axis of the text, are only 'as if' accounts - stand-ins for properly accurate, non-allegorical analyses and expositions (VI.506D-507A).
As well, whatever Socrates says about the psuche (soul) and its virtues (aretai) is provisional. At IV.435c–d and 504b ff.VI we are told that the full, precise truth about these matters can only be discovered via a longer road on which the Republic cannot embark. Whatever Socrates engages in, it is not the dogmatic speechifying of a supposedly all-wise figure.
Christopher Rowe, 'Socrates and Plato', Phronesis, Vol. 44, No. 1 (Feb., 1999), pp. 72-82.
Daniel W. Graham, 'Socrates and Plato', Phronesis, Vol. 37, No. 2 (1992), pp. 141-165.
Gregory Vlastos, 'The Socratic Elenchus', The Journal of Philosophy, Vol. 79, No. 11, Seventy-Ninth Annual Meeting of the American Philosophical Association, Eastern Division (Nov., 1982), pp. 711-714
Michel Meyer, 'Dialectic and Questioning: Socrates and Plato', American Philosophical Quarterly, Vol. 17, No. 4 (Oct., 1980), pp. 281-289.