How can I connect a set of disconnected vertices with a line through all of them
Select two vertices and create an edge between them, repeat for each edge you want.

With two vertices selected blender will create an edge, with three or more vertices it will create an edge between each vertex as well as a face that is surrounded by all of them. If the vertices are aligned the face will be too small to be seen even though it is there.

You could select the vertices from one end to the other and create a face, then use X->Only Faces to only have edges, but this will still leave an extra edge from the first to last, and the remaining edges will only be worthwhile if you select them one by one in the right order, if you use select all then you can get edges between random vertices in the row.

This is a drawback of using the same operator to create edges and faces, the number of selected vertices is the only factor that decides if a face is created, so to create only edges you need to select two vertices and create one edge at a time. As you may want to create edges between all the vertices you have in the grid, you may want to fill in the grid with faces (enabling the F2 addon might help), then select everything and delete only faces to have only edges remaining.

If you enable vertex snapping and auto-merge you could select the first vertex and press E to extrude it and snap the new vertex to the next vertex, then repeat for each edge.