Can a piece pinned to my king put the opponent's king in check? I was playing a game with a friend online. A situation came up where he put me in check with his bishop, and I moved my rook to block it. His king was on the g file and my rook was on g2. The website said he was in check. 

[fen "6k1/8/2b5/8/8/8/6R1/7K b - - 0 1"]


Position after Rg2+ , showing only the pieces important to the question.

I didn't think it could be a check, since legally, I could not attack his king or move my rook because it would put my king in check. Can a piece put a king in check even though moving that piece would be an illegal move? 

This is odd, because since he was forced to respond to the check, I was able to make a couple moves and leave him with only a couple of blocked pawns, while I was able to promote a pawn and mate in a couple moves. I won, but it feels like cheating. He had a better position and should have won.
Yes. Besides making sense, it's also explicitly stated in the rules of the game:

3.9
The king is said to be 'in check' if it is attacked by one or more of the opponent's pieces, even if such pieces are constrained from moving to that square because they would then leave or place their own king in check. No piece can be moved that will either expose the king of the same colour to check or leave that king in check.

Source: Laws of Chess on the FIDE site