This helps you in a number of ways. At a very simple level, because it is in the diary, you are more likely to do it. This works in part because you have decoupled the decision from the event, and by that I mean you have decided on Sunday to exercise, but the event is on Tuesday. By putting it in the diary, mentally you have accepted that you will do it; if on Tuesday your motivation is not so high, you are still more likely to do it. Not to do it is actually a fresh decision; doing it is therefore the default mode. Instead of actively deciding to do it, you have to actively decide not to! Also, you have only had to make one decision to exercise twice rather than having to make two (one on Tuesday, one on Friday). This reduces the risk of deciding to take the easy option.
Second, once you put it in the diary, it safeguards the time. New meeting or events are slotted in around your existing commitment (the gym) so it is less likely to be edged out your schedule. If an event does end up clashing with your gym time and that event simply has to take priority, the gym is easily rescheduled to another available time. No longer will you have the excuse that you can't find the time because the gym is incorporated in your time management framework.
Finally, the entry (of the gym) in the diary flags to you that your gym event ranks equally with other events in your life.
And if you really want to make this work for you, once you have decided to go to the gym on say Tuesdays and Fridays, put it in your diary as a recurring entry for the next 12 months. Then you have made one decision for 104 work out sessions. That is a major step forward in moving you toward achieving your goal.