Since each program has one structure, the correct sentence is
Program A and program B have the same structure: they both have a sequential structure.
There is a single structure, which is shared by the two programs. The “same structure” in the first sentence is the sequential structure, there is only one. Other ways to formulate this idea include
The structure of program A is the same as the structure of program B.
Both program A and program B have a sequential structure.
The structures of program A and program B are the same.
In this last example, the structure of A and the structure of B are introduced before it is claimed that they are the same, so there are two structures which are then claimed to be identical.
With the original formulation, the plural would imply that each program has many structures.
These two C programs have the same structures, defined in a common header.