Security for IoT applications is an extremely important topic that deserves many entire books dedicated to it. Each solution has its own security requirements and it is very important to consider all of them when developing each component of the solution.
If we use MQTT to publish values that are neither confidential nor critical for other applications, our only concern might be to keep control of the maximum number of subscribers to each topic to make sure messages are always available. This way, we can prevent the MQTT server failing to deliver messages to a huge number of subscribers.
However, most of the time we won't be working on a solution that can share data with the entire world without limitations and doesn't need to care about data confidentiality and integrity, in addition to data availability. Imagine...