Jessie Fleming's second-half penalty was enough to see Canada stun the reigning world champions.
The USWNT has now failed to reach the final in back-to-back Olympics after suffering defeat at the hands of Sweden in the quarterfinal round at Rio 2016.
The Americans have won the Olympic women's football tournament four times and have not been beaten by Canada for over 20 years. It is only the fourth time Canada has beaten the U.S. in 62 meetings.
The USWNT suffered a major setback in a cagey first half when goalkeeper Alyssa Naeher was forced off with a knee injury after 30 minutes.
Canada's veteran striker Christian Sinclair initially had the ball in her hands, but Fleming took the responsibility and kept her cool to slot home.
The USWNT come close late on when Lloyd hit the crossbar but Canada held on to win.
Canada will feature in their first ever Olympic final and play Sweden in the gold-medal match at the Olympic Stadium in Tokyo on Friday.
The USWNT has endured a difficult tournament, starting with a 3-0 loss to Sweden that snapped a 44-game unbeaten streak, and a scoreless draw with Australia in the group stage.