I would say in the case of a relational database like MySQL, it is absolutely the right decision to have the database enforce the uniqueness of a column.
Enforcing data integrity is a main feature of databases, and unique columns are an integral part of this ability. In the case of a key column, there are also performance benefits of looking up records by id when the enforcement lives in the db.
Finally, when you're running a distributed application where many users can simultaneously create records, you get the unique guarantee for free, instead of having to synchronize key creation yourself.