You could try joining the open points: Select the two points on the left side of the triangle using the Direct Selection Tool (White arrow) and press CTRL+J.
That should close the path and make the third side of the triangle. At that point you could change the fill of the triangle, or select both the square and triangle together before retrying your Pathfinder operation.
Edit: In case you're new to Illustrator, selecting more than one point (or object) can be done by clicking on the first item and then holding Shift while clicking on the next one.
Your path was not filled as you expected so either:
your newly drawn triangle wasn't actually touching the square, easily verifiable if you zoom in close enough. Just use the smart guides (View > Smart Guides) when creating a new shape to ensure the new vertices touch the existing shape.
you could've just filled the triangle as it was; just select it by clicking on the stroke (not inside the triangle, if it doesn't have a fill you'll be selecting the square behind it) and add the fill color.