And great multitudes were gathered together to him. Here he sets down the hearers: for when the mind goes out to public teaching, then many can hear and profit; Sirach 51:31: draw near to me, you unlearned, and gather yourselves together into the house of discipline. Next the disposition of the teacher and hearers is set down; hence it is said, so that going up into a boat he sat down. And why into a boat? There can be a literal reason, because the hearers were many, and therefore he wished to have them before his face, so that they might better understand. For all things were before him; Job ...13:1: behold, my eye has seen all things. Another reason is mystical, because by the ship the Church gathered from the Gentiles is signified, where he sits through faith, and teaches those who stand on the shore, namely, the catechumens, who are prepared for the faith. Or otherwise, that Jesus was on the sea, while the hearers stood on the shore, and in this he gives an example to preachers, namely, that they should not expose their subjects to dangers. And this is signified in Exodus 13:17ff., that when Moses led his people out, he did not lead them by the way of the land of the Philistines, thinking lest perhaps they would repent and return to Egypt. Therefore Jesus sat in the turmoil, but left the others outside; hence it is said, and all the multitude stood on the shore.
Source: Commentary on Matthew