If I had to create a board like that that has to have a certain amount of valid words, I would first create an algorith that can find words given a wordlist within that matrix. This has the following benefits:
- You can see how hard a board is to solve. The more words your algorith finds, the easier the board gets.
- If your game has a fixed level layout (means lvl XYZ should return always the same board), you can calculate the total points a level can give and reward accordingly stars for a level
Now that you can test a level, you can actually pick multiple ways how to generate a board. The laziest version would be to use a random letter for each field. Since you can test it, if you do not get enough words, simply recreate a new board.
A slightly better result would be to use a scrabble list for the language you target. They usually are a distribution of how often a letter is used. Now instead of randomly using a letter, you pick one by random from the list. Since some letters are more often in there, you will pick them up more often. (Might be better to pick and remove the letter from the list to not have the rare choosing of 4x Z and 3xY)