If a player gets a 2 match suspension and the referee fails to observe that this is the case until half time and his team uses him during the suspension period what penalty do the rules allow for in this case?
Different competitions have different suspension rules.
However, in most major competitions, it is not the job of the referee to check for eligibility of the players in a team's lineup. That job is given to an official provided by the competition organizers. This official shall check that every player mentioned in the team list (including substitutes) is eligible as per the competition rules.
If even this official does not spot that a suspended player has been selected, the match can either be handed to the opposing team by forfeit, or be replayed, again depending on competition rules or decision made by the organizers of the competition.
For example, in the third qualifying round for the 2014/15 UEFA Champions League, Scottish club Celtic should have lost 6-1 on aggregate to Polish club Legia Warsaw. After losing the away game 4-1, Celtic then lost 2-0 at home. However, it transpired that Legia had used a suspended player as a substitute towards the end of the second leg. Celtic were consequently awarded a 3-0 victory and went through on away goals after the aggregate score was tied at 4-4.
The opposing team can ask to replay the match or the victory 3-0 by forfeit.
e.g. match results assigned by forfeit:
Here from the UEFA Disciplinary Regulations
Article 21 - Forfeit
3 A match may be declared forfeit if a player who is ineligible under the regulations of the competition concerned participates in the match...
4 The consequences of a match being declared forfeit are as follows: a) the team forfeiting the match is deemed to have lost 3-0 (5-0 in futsal competitions), unless the actual result is less favourable to the member association or club at fault..
According to the Brazilian Code for Sports (CBJD, link in Portuguese), rule 214, the team that used the suspended player is punished with the loss of any points obtained in the specific game, in addition to the loss of three points in the competition and a fee between R$100.00 (~U$33.00) and R$100.000,00 (~U$33,333).
Note that the other team is not awarded with a win. The result is maintained, e.g. if the offending team won the match, it loses the three points from that game, plus another three points; but the adversary don't get any additional points. If the offending team lost the game, it is still subjected to a loss of three points in the competition. If the nature of the competition doesn't allow the loss of three points, e.g. it is a single elimination game, the team is excluded from the competition.
One famous case occurred in 2013 when Portuguesa finished just above the relegation zone but in the last game used one suspended player in the last 15 minutes of the match. The club lost the four points - one awarded for the draw in that fatal game plus other three points - and was relegated to the 2nd division.
The difference in the fee is to accommodate the huge difference between 1st national division clubs and very small clubs that play only in regional leagues.
As you could see, the Brazilian regulation is different of the one used by UEFA as the other team is not awarded with a 3-0 win. The rule is defined and enforced by the competition organizer, not referees in the field.
If a suspended player is used, then the team might risk losing the points for that particular match. The match would be counted as a 3-0 victory for the other team.
This happened very recently with Bolivia in the CONMEBOL qualifiers for the 2018 World Cup. Chile and Peru got the points they had lost against Bolivia since the latter team had used a suspended player.