Can you explain the behavior of this snake?
You're right, snakes rely on scent to capture their prey. The fact that snakes are carnivores may be the one constant among all snake species; absolutely none feed even partially on plant matter. So if plant matter is found in their feces, it must have gotten there accidentally. 

Here, check out this post, which answers your question perfectly:


  In most instances, these have been attributed to accidental ingestion, perhaps eaten with a prey item or mistaken for prey by scent...One interesting case was discovered by Harvey Lillywhite in a study published in the journal BioScience in 2008. Studying the scavenging behavior of pitvipers in the intertidal zone, Lillywhite observed cottomouth droppings that were composed almost entirely of seaweed. This was too much plant material to have been eaten secondarily or by accident, and he suspected that there was some other cause for the snakes to be eating it (it certainly wasn't for energy as the seaweed was passing through completely undigested. Lillywhite wondered if it was possible the snakes were feeding on seaweed simply because it smelled like fish. An interesting laboratory experiment proved their hypothesis correct; they offered various plants to cottonmouths, some with fish and others without. The plants without fish were investigated by the snakes, but ultimately left uneaten. Those that did contain fish were quickly devoured. Even when the fish was removed, the snakes ate the remaining seaweed simply because it smelled like their prey!