$F=ma$. If $F=0$, and $m=0$, $a$ can be anything. Most physical laws are not "A causes B". They usually say that "A and B can coexist in these conditions". So, it is not necessarily "Force causes acceleration". It is "an accelerating body can coexist with a force if $F=ma$"
The net force on a massless string is always 0 -- it has to be (otherwise it will have infinite acceleration). Whenever we draw free body diagrams of systems that contain massless strings, we always take a tension force $T$ that represents the string "pulling" the body. Take the reaction force of $T$ on the string and you'll notice that the string is always in equilibrium.
For example, take this system, where someone is pulling a set of two boxes interconnected by a string:
Note that the reaction force of $T$ (in red) on the string balances itself.
For a more complicated system, take the following:
(I've taken a massless smooth pulley here. If the pulley wasn't smooth, then the tensions in the two portions of string would be different. If it wasn't massless, the force from the ceiling would be different)
In this system $T$ balances out on the string as well. This is precisely why we say that a section of string exerts $T$ on both ends — to maintain equilibrium.