Yes, you shouldn't let that happen. King is not in check and you took away any legal moves from your opponent by taking that pawn. Those are the rules--that is the definition of a stalemate.
Don't worry, it doesn't mean you should feel bad about it. Just be careful to watch out for stalemates in the future.

Hello, I've just played this game
https://www.chess.com/game/live/90018604067
Why did the game stalemate?? My (black) position was way superior, I even took the pawn to prevent "stalemate because no pieces were taken for too long"...why the hell thit this take place? I had a ton of legal moves. Please explain. Neither me nor the opponent surrendered.