Should I mention in my thesis that a live demonstration motivated me to implement an algorithm instead of others?
Yeah, definitely.  

Comments on the reason you started work are totally appropriate in the introduction of a thesis and even make it a little less dry.  It makes it a little more of a narrative.  You still have to show all the dry results and analysis and all that.  But some minicum of storyline is actually a positive.  

Actually even in a paper (where you are limited in format and space to concentrate more on results), some motivational comments in the intro are still totally in place in the introduction.  They set context, they help people.  In a thesis, even more scope is available and desired for explaining motivation (which gives contextual insights).  In science talks it is also very important (not just allowed) to show motivation (personal, economic, or social) in the intro.

I'm sure it is possible to overdo it, but in general, the issue is more the opposite (people not explaining personal motivation, inspiration from other researchers, economic motivations, etc. sufficiently).