The theta is there because the only part of the force that matters is the component that is helping you go in the direction that you are going in.
A good (but tricky) example of this is work done by a magnetic field. Force of a magnetic field is: F (vector) = q<v x B>.
Cross product only involves the perpendicular components. This means that the force from a magnetic field on a charged particle will always be perpendicular. Since the force is perpendicular to the direction its going, theres no work, theta = 90.