Why do fencers only move back and forth in a straight line instead of circling around like in the movies?
Because modern fencing grew out of thrusting swordplay where the fastest, safest attack is a straight line, and the sport then built its strip and rules around that. With a long, light weapon that scores with the point (and, in sabre, the edge), the fight is almost entirely about distance: whoever reaches the target while staying out of the other's reach wins. Stepping sideways or circling takes time and usually just opens a straight path for the opponent's point, so fencers settle the question forward and back.
This is far older than electric scoring. In the 1500s and 1600s some schools, most famously the Spanish destreza, used circular and angled footwork around an imagined circle. The French and Italian schools favored the lunge, a long straight thrust from distance, and by the 1700s the French style had become dominant. Foil, épée and sabre descend from that line of teaching, and fencers were competing on marked strips long before electric scoring arrived at the Olympics, which began with épée in 1936. Movie sword fights are choreographed for the camera, and circling simply looks good on screen.
The strip makes the line official. It is 14 meters long and 1.5 to 2 meters wide, so there is room to step sideways, and fencers do use it to change angles. If you cross a side line with one or both feet, the referee calls halt and you are moved back one meter from where you left, or, if you went off during an attack, back to where the attack began and then one more meter. Crossing the side with both feet to avoid being hit is a yellow card, stepping off the back end with both feet gives your opponent the touch, and turning your back on your opponent is not allowed.
Practical reasons keep it this way too. A narrow strip lets a club or tournament fit many bouts into one hall, the referee can always see both fencers from the side, and the scoring cables run along the strip. If you want open, circular fighting, historical fencing usually fences in wider rings. In Olympic fencing, put your energy into distance instead: small steps forward and back, changes of rhythm, and knowing exactly where your lunge reaches.