San Jose is the capital of the country, an important hub of politics, commerce and culture, and 3/4 of the population live in this area. There's a couple good museums, interesting night life and cuisine to discover, theatre, casinos, etc.
But few people come to Costa Rica to see San Jose. We come here for the rich abundant life of the jungle, the beautiful beaches and warm water, the world class surf, the volcanoes, to see life and energy exploding around us, NOT to see a grubby-faced city going about its daily life. But as the hub of the country, it can be hard to avoid. The biggest reason people stay in San Jose is a logistical one. For most people San Jose is a layover till the next morning when they can move on to the next location or fly out.
If your flight arrives any later than mid-day, I suggest you plan to stay the night. All the public transportation from SJO to PV leaves relatively early in the day. The last public bus departs at 4:00pm, which you will likely miss if your flight lands at 2:00pm or later. Even if your flight arrives earlier, you may want a hotel bed more than another four to five hour drive to Puerto Viejo.
Having to stay a night in San Jose does offer an advantage. It gives you an opportunity to enjoy an adventure on the way to Puerto Viejo or the way back to San Jose. If you must spend the night in San Jose on arrival, then the next day you can go rafting or visit Tortuguero National Park on the way to Puerto Viejo. If you must stay in San Jose the night before your flight home, you can do a raft trip or visit Tortuguero on the way back to San Jose. Usually your travel day is pretty wasted. But this way, instead of wasting a day traveling, you can enjoy a day or two of adventure, possibly your best adventure in Costa Rica, and end up where you need to go.