Yes, iMovie has a rotate function. Click on the small gear icon at the start of the clip. Select "Cropping & Rotation" from the pop-up menu. In the viewer you will see 2 arrows at the top centre - the left arrow rotates the clip 90 degrees counter-clockwise, while the right arrow rotates 90 degrees clockwise. So, click on the left arrow to bring your clip into the correct portrait position.
You can also bring up the rotation tools (plus Fit, Crop and Ken Burns) by clicking on the clip then on the Crop tool in the centre toolbar directly to the left of the Inspector icon (white i inside a black circle). Alternatively, click on the clip then press the c button on the keyboard. Like most things Apple, there are always several ways of doing things!
PS. Don't forget to click Done at the top right of the viewer after you've rotated the clip!
Message was edited by: John Cogdell - added PS