A square pyramid has 4 sides that are triangles and a square base.
A plane that contains the vertex (top of the pyramid) and is perfectly vertical, must contain the vertex, the lines formed by the intersection of the plane with the left and right triangles, and the line formed by the intersection of the plane with the square. So the figure must be a triangle.