There's nothing wrong with the method you suggest - many successful imageboards were built on that mechanism. However, a large site built on this method can become quite complicated.
People use databases for the functionality they offer:
Ad-hoc queries
For example, on an forum built on your method, you can't easily determine how many threads each board contains, or allow users to sort threads, without writing code for that purpose.
Easier to maintain
Schema changes are managed by the DBMS - no need to write code to iterate through the records in a file and update the layout of each.
Efficient
Fast data structures, indices and query planners can significantly outperform primitive file systems.
Data integrity
Database management systems support many constraint mechanisms to prevent and warn about attempts to modify the database in invalid ways.
For more, see database vs flat files or try a web search: advantages of a DBMS