Would adding anecdotes in statement of purpose be necessary?
In writing, there is a general principle of "show and don't tell" which applies.
It's not the question of to anecdote or not per se, but whether the illustration provides some insight into how you are unique.  If a (short) anecdote can illustrate something important about your creativity, initiative, or problem-solving skills, then it will help you stand out and can be useful to include.

For example, compare these two statements:


I founded a student group that teaches underprivileged high-schoolers to program.
When I was growing up, an important turning point in my education was when a friend's older brother taught me programming.  I wanted other people to have the same experience, so I organized some friends and reached out to local teachers.  Together, we founded a student group that teaches underprivileged high-schoolers to program.


The second is longer, but it tells a lot more about why what the writer did was significant and shows how they expressed initiative and motivation.