Why do the geometries of alkanes, alkenes, and alkynes differ?
Because of the ways the bonds differ.
A single bond (as in an alkane) may rotate freely.
A triple bond (as in an alkyne) does not rotate, but it has only one valency left on the two carbon atoms.
A double bond can also not rotate, but it has two valencies left. It is therefore possible that groups are at the same side or at opposite sides of the double bond. These are called cis- or trans- isomers respectively, or recently Z- and E- isomers.
cis- or Z -but-2-ene
trans- or E -but-2-ene
Butane could change between these forms and others (without the double bond everything is free to rotate), while but-2-yne will be linear.