I've learned that both of these can be used to mean “I hope that...” or “I wish that...” but what is the difference in meaning?
Do these have the same meaning?
The first phrase translates literally as "if tomorrow is clear, (I think) that will be good."
The second phrase is a sort of ambiguous shortening of ～ように願｛ねが｝っています, "I am hoping for ~" or similar ending.
Similar to a lot of Japanese phrasings, when you are talking about yourself (or implying) then emphasis is on a much more personal, closely held belief/feeling/want. However the first is simply stating a logical fact that is probably shared by many people.
I think in this case the first one would be more appropriate in a casual, "I simply want the weather tomorrow to be nice for us all". But if there's something personaly important that is dependent on the weather tomorrow (eg. a sports game, a vacation), the second phrasing might be more appropriately emotional.
Yes, both are used to express wishes and hopes, but the difference is that, if you say 「～といいな。」, you are merely expressing your hope/wish whereas when you say 「～ますように」 you are, at bottom, also appealing to a higher being. That is, expressions of the form 「～ますように。」 are prayers.
Which is not to say that only religious people say things like「明日晴れますように。」. Non-religious people do say things like 「明日晴れますように。」 in much the same way they say 「明日晴れるといいな。」(though probably less frequently than they say the other), as a matter of idiomatic expression.
Naturally, all prayers are also expressions of wishes but not all expressions of wishes are prayers. One example of the contexts where the difference is marked would be when you visit (often more out of social necessity than religious passion) a Shinto shrine and make a wish. What you utter or mutter (internally, in most cases), for instance, would be 「世界が平和になりますように。」 rather than 「世界が平和になるといいな。」