You can be compelled to testify under oath for many reasons none of which involve doing anything wrong. When you testify under oath, you must answer the questions asked truthfully or face unlimited jail-time for contempt.
The fifth amendment is the only form of protection you have from being called to testify and being grilled about any random topic. It's a balance to the otherwise tremendous power that a court has.
The prosecution must be able to make their case without the defendants assistance. This is a fundamental aspect of our legal system.