What makes DNA/Protein in a gel run in straight lines?
What you are trying to achieve in the electrophoresis experiment is a homogenous electric field. If the electric field points downward homogenously, then the greatest force will be exercised in a downwards direction which will lead to a downwards movement of your charged sample.

While not being exactly equivalent, you can show a similar feature (homogenous field) with a horseshoe magnet. If you place a piece of paper or cardboard over the top of it and then sprinkle iron filings onto that, they should arrange themselves in a linear fashion between the magnet’s poles.