Why was there advancing (particularly by the allies) until the last minute before the armistice came into effect? Below is a quote from Wikipedia.
French commander-in-chief Marshal Foch refused to accede to the German negotiators' immediate request to declare a ceasefire or truce so that there would be no more useless waste of lives among the common soldiers. By not declaring a truce even between the signing of the documents for the Armistice and its entry into force, "at the eleventh hour of the eleventh day of the eleventh month", about 11,000 additional men were wounded or killed – far more than usual, according to the military statistics.[12]
I can only answer for the British Expeditionary Force on which I am currently completing a PhD. It is important to remember that 11 November was an armistice, but it was not the end of the war, which happened in 1919.
There is no single explanation for why fighting continued right up to it and why an immediate ceasefire was declared. But the two main ones are the simple facts the Germans weren't necessarily beaten, and they were still on French/Belgian soil.
With the Germans not being beaten, there was the potential for them to drag the war into 1919 if they managed to delay the Allies. Whilst 385,000 German prisoners were captured by the Allies in the final campaign of the war (18 July - 11 November) many German formations were continuing to retreat, and were still capable of offering resistance. As whilst the last major Allied operation of the war was the Battle of the Sambre on 4 November, a clear Allied victory, the last 7 days of the war saw a continuous pursuit of German forces which put up a fierce resistance right up until 11 November.
The continuing wariness of German forces is show in the message sent by British General Headquarters to it Army commanders following the signing of the Armistice. This signing happened at 5.5am on 11 November and at 7.30 a message instructing troops to 'stand fast on the line' as of 11.00 and maintain 'defensive precautions' was issued. [Found within Volume V of Military Operations France and Belgium 1918]. This wasn't a clear and comprehensive defeat a la 1945 where it was clear the war was over.
And the fact they were still on French/Belgian soil and the implications of this are obvious. On 11 November the British armies were still liberating Belgian towns including Mons and Villers St Ghislain.
In summary - they kept fighting till 11 November because they were never sure the Germans were truly defeated, and the Germans remained on Allied land.