To check the database before trying the insert, you either end up introducing a race condition, or you take out a key-range-lock (which could cause blocking, etc). In either event, it is going to have to check for the duplicate anyway when you actually insert, so you're purely adding work (and possibly an extra round trip).
It does depend a bit on how likely it is to be a duplicate, but in the majority of cases: this is exceptional, and should probably be handled as such - via an exception when the database reports a problem. BUT: there will always be some scenarios where it is sensible to check ahead of time - and in those cases, you might do both. For example, in a data-entry application, as soon as the user enters a value into the key input here, and tabs to the next control - you might check the database in the background to verify that there is not already a value: but - you still need to be prepared for the fact that data changes constantly, from multiple sources - so no matter how you check, it could still be a duplicate at the time you insert.