One of the many things that became apparent after the American Civil War was that the infantryman needed a means to quickly construct earthworks.
“Hardtack and Coffee” informs us that the quartermaster of the army had wagons of intrenching tools [sic] that were supposed to be supplied to units that needed them.
In practice, there was seldom time to send for these tools, and infantrymen resorted to digging with their tin plates or muckets.
As you can see, there were attempts to modify spike bayonets for the role.
One of the solutions offered after the war was the Rice trowel bayonet, which began to see trials in the late 1860s.
Available on-line is a document detailing the findings of the trails.
While a few officers expressed reservations, the opinion of the enlisted men and many other officers was overwhelmingly positive.
The document describes “rifle-proof” parapets being constructed in as little as nine minutes.
This would be impressive, even with larger modern tools.
The trowel bayonet was clearly superior to the improvised means the troops had been using before.
It also had sufficient size, heft and edge that it could be used to cut saplings and branches, something beyond the current spike bayonet.
Many believed the large, spear-like blade would make a better bayonet than the spike bayonet.
Breech-loading rifles were coming into service, and many were of the opinion that the bayonet might be becoming obsolete. If it wasn’t quite as good a bayonet as the weapon it replaced, this was tolerable and its greater utility made up for this.
The main objection to the trowel bayonet was that troops might be tempted to dig with it while it was mounted on the rifle. This was likely to bend the barrel, damage the muzzle or block the bore. (One reviewer does point out that the trowel was a less effective digging tool used in this way, so the practice will be rare. Someone was bound to try it, however).
Shortly after the introduction of the trowel bayonet it was replaced with a trowel knife. This probably had a better grip than the trowel bayonet, but its rounded tip gives it a less war-like appearance and possibly it was of less utility as a hand weapon.