What is the origin of 洋罪?
This is really an interesting question, even as a native speaker I don't know the meaning it implies, so I did some bits of research and this answer came into my sight, which perfectly convinced me:

Original reference: [http://zhidao.baidu.com/question/18385575.html]


  所谓洋货,意思是从海洋上"漂"过来的货物,现在的话就是进口的,以前一般都是从海洋上来,所以叫洋货. 
  
  洋罪主要是日本奴役统治中国部分地区的时候,对老百姓机器恶毒,劳动强度高,生活水平却极其低,就是遭罪,而且一般的罪没法比,那罪来源于洋人_日本人,所以叫洋罪. 


The first one is talking about 洋货, of which I think you have perfectly grasped the meaning, i.e. things imported from outside China, since most goods need to be transported by the sea(洋), later people call it 洋货.

Now I will try to translate the second sentence:

洋罪 talks about the times when Japan ruled some parts of China, by those time the Japanese extremely maltreated the common people, there was a high labour intensity, meanwhile the people suffered a very poor and miserable life, but not any other misfortune can be made to compare with it because it came from 洋人(the foreigners), by so, it's called 洋罪.

Up to now, people still use this word, but the meaning of suffering from foreigners has faded out a lot, only to emphasise an unexpected feeling of sufferings.

So, in most cases if you suffer, you only say 遭罪, only in some unexpected cases, which you totally can't foresee it but you still suffer, you say 遭洋罪.

Examples:


今早上班地铁特别挤，我一直站了1个小时，真是遭罪啊。

This morning the subway is extremely crowded and I had to stand all along for an hour, I really suffered a lot!
今早上班地铁特别挤，我一直站了1个小时，中途地铁又坏了，我又换乘公交车，真是遭洋罪啊。

This morning the subway is extremely crowded and I had to stand all along for an hour, what's more, the subway broke down in the middle way so I had to take a bus instead, I could not suffer more!