In the AskHistorians FAQ I stumbled upon this post that says:
most contemporary historians tend to agree that it was more likely German commanders felt constrained by their supply lines as they had rapidly advanced through France and the Low Countries faster than their supply lines could keep up as well as German forces wishing consolidating their forces before making a final push
Meanwhile, however, I have heard that, at least in Frieser Karl-Heinz's Blitzkrieg Legend, there is no mention of logistics. The reason, I understand, is not known, with some presumptions that the reason was to wait for the infantry.
So, do or do not historians agree on logistics being the reason? Because if they don't, the FAQ linked comment is erroneous.
Having sifted through many opinions there is not a single, simple reason. But nor is the 'halt order' the insanity it appears to be in retrospect.
Supplies were certainly a major consideration. The Germans did not carry out the so-called Blitzkreig with seamless efficiency, it was in a sense a handful of armoured commanders pulling along a more conservatively-minded German army (and political high command) with them.
What they saw at Dunkirk was a concentrated British army, famously capable of stoic defence (if rarely flamboyant attack), being confronted by panzer divisions spearheads depleted and to some extent confused by their rapid passage through France. The horse- and foot-bound majority were well behind, but also the cutting edge of those spearheads was depleted and the British still had ample artillery, tanks, ammunition and fighting spirit. Poland and Arras had provided examples of panzer divisions being sharply countered when faced with organised resistance.
The other factor was the Luftwaffe. Goering was famously confident and glory-seeking and offered a solid alternative for demolishing the BEF. The extent to which Dowding had husbanded the resources of the RAF was not known, so there was no reason to doubt Luftwaffe supremacy over the beaches. And Hitler dismissed Chamberlain, still the British PM, as weak and ineffectual. The Luftwaffe had furthermore proven quite capable of taking over when the Wehrmacht stumbled, for instance the 4th Panzer Div outside Warsaw.
So I think it's fair to say the consensus is a combination of logistics, fear of the weakness of locally-available German forces, the promise of air strikes achieving a decisive effect, and an overall underestimation of British resources and determination.
Heinz Guderian was one of the German commanders on the ground during the operation in question, and his memoirs talk about this.
According to Guderian in Panzer Leader, "On [the 24th of May] the Supreme Command intervened in the operations in progress, with results which were to have a most disastrous influence on the whole future course of the war. Hitler ordered the left wing to stop on the Aa. [Italics his.] ...We were not informed of the reason for this... The order contained the words: "Dunkirk is to be left to the Luftwaffe. Should the capture of Calais prove difficult, this port too is to be left to the Luftwaffe." (I quote here from memory.) We were utterly speechless."
He goes on to report being repeatedly given stop-and-go orders to advance on Dunkirk, then stopping within sight of it, watching the Luftwaffe attack and seeing the massive British evacuation fleet.
Guderian then says "The operation would have been completed much more quickly if Supreme Headquarters had not kept ordering XIX Army Corps to stop and thus hindered its rapid and successful advance. What the future course of the war would have been if we succeeded... it is now impossible to guess. ...Unfortunately the opportunity was wasted owing to Hitler's nervousness. The reason he subsequently gave for holding back my corps- that the ground in Flanders with its many ditches and canals was not suited to tanks- was a poor one."
Guderian goes on to mention the theory Churchill posits in his memoirs of the war, "that some of the German generals suggested that by holding up his tanks outside Hitler was hoping either to give the English and opportunity to sue for peace or to increase Germany's chances of negotiating a settlement. Neither then nor at any later period did I ever hear anything to substantiate this suggestion." He then goes on to criticize Churchill's version some more regarding von Rundstedt- Guderian doesn't seem to have much cared for old Winston's take on the war, unsurprisingly.
Anyway, it's up to you whether you want to take Guderian's word for it or not. He was there, but of course his perceptions and memories may have been colored by his closeness to the whole affair. But Guderian, who is elsewhere in Panzer Leader quite good about mentioning logistical issues and difficulties, doesn't say a word about them here.
N.B.: For what it's worth, this is not the only time Guderian piles the majority or entirely of the blame for German operational failures on Hitler. Not saying he's wrong, but you could certainly interpret it as him having an axe to grind with Hitler (for some unfathomable reason.)