You can set this up in FileMaker 10,11, or 12.
One option is to discard table 2 completely. You can set up a summary report with one row for each expense category to show the total spending in that category. You perform a find for the records you want in your report (such as all records for spending in a particular time period), sort the found records and you have what you describe here. All fully dynamic.
To do this, set up a summary report layout based on your expenses table. Remove the body layout part from this layout. Replace it with a sub summary report "when sorted by" your expense category. Put a field (can be from your related third table) for the expense name and a summary field that computes the total of your expense amount table in this sub summary layout part. As long as your records are sorted by the same field that you specified as the "when sorted by" field in the sub summary part, the sub summary part will be visible.
The find and sort you use to pull up the records used in this report can be done manually (but may need to be performed on a different layout based on the same table) or via a script.
If you still want that 2nd table, it can show category expense totals if you use a relationship that matches by more than the expense category. It can match, for example, by a pair of global date fields in addition to the category ID field.